Commit f11827ae authored by Joshua Harlow's avatar Joshua Harlow

Fix up a ton of flake8 issues

parent 690bdce9
...@@ -207,20 +207,20 @@ def add_sources(srclist, template_params=None, aa_repo_match=None): ...@@ -207,20 +207,20 @@ def add_sources(srclist, template_params=None, aa_repo_match=None):
ks = ent['keyserver'] ks = ent['keyserver']
try: try:
ent['key'] = getkeybyid(ent['keyid'], ks) ent['key'] = getkeybyid(ent['keyid'], ks)
except: except Exception:
errorlist.append([source, "failed to get key from %s" % ks]) errorlist.append([source, "failed to get key from %s" % ks])
continue continue
if 'key' in ent: if 'key' in ent:
try: try:
util.subp(('apt-key', 'add', '-'), ent['key']) util.subp(('apt-key', 'add', '-'), ent['key'])
except: except Exception:
errorlist.append([source, "failed add key"]) errorlist.append([source, "failed add key"])
try: try:
contents = "%s\n" % (source) contents = "%s\n" % (source)
util.write_file(ent['filename'], contents, omode="ab") util.write_file(ent['filename'], contents, omode="ab")
except: except Exception:
errorlist.append([source, errorlist.append([source,
"failed write to file %s" % ent['filename']]) "failed write to file %s" % ent['filename']])
......
...@@ -38,7 +38,7 @@ def handle(name, cfg, cloud, log, _args): ...@@ -38,7 +38,7 @@ def handle(name, cfg, cloud, log, _args):
content = util.shellify(cfg["bootcmd"]) content = util.shellify(cfg["bootcmd"])
tmpf.write(util.encode_text(content)) tmpf.write(util.encode_text(content))
tmpf.flush() tmpf.flush()
except: except Exception:
util.logexc(log, "Failed to shellify bootcmd") util.logexc(log, "Failed to shellify bootcmd")
raise raise
...@@ -49,6 +49,6 @@ def handle(name, cfg, cloud, log, _args): ...@@ -49,6 +49,6 @@ def handle(name, cfg, cloud, log, _args):
env['INSTANCE_ID'] = str(iid) env['INSTANCE_ID'] = str(iid)
cmd = ['/bin/sh', tmpf.name] cmd = ['/bin/sh', tmpf.name]
util.subp(cmd, env=env, capture=False) util.subp(cmd, env=env, capture=False)
except: except Exception:
util.logexc(log, "Failed to run bootcmd module %s", name) util.logexc(log, "Failed to run bootcmd module %s", name)
raise raise
...@@ -198,7 +198,7 @@ def is_device_valid(name, partition=False): ...@@ -198,7 +198,7 @@ def is_device_valid(name, partition=False):
d_type = "" d_type = ""
try: try:
d_type = device_type(name) d_type = device_type(name)
except: except Exception:
LOG.warn("Query against device %s failed" % name) LOG.warn("Query against device %s failed" % name)
return False return False
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
import os import os
from cloudinit.settings import PER_ALWAYS
from cloudinit import log as logging from cloudinit import log as logging
from cloudinit.settings import PER_ALWAYS
from cloudinit import util from cloudinit import util
frequency = PER_ALWAYS frequency = PER_ALWAYS
......
...@@ -37,8 +37,8 @@ If cloud-init sees a 'fan' entry in cloud-config it will ...@@ -37,8 +37,8 @@ If cloud-init sees a 'fan' entry in cloud-config it will
""" """
from cloudinit import log as logging from cloudinit import log as logging
from cloudinit import util
from cloudinit.settings import PER_INSTANCE from cloudinit.settings import PER_INSTANCE
from cloudinit import util
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
......
...@@ -66,7 +66,7 @@ def handle(_name, cfg, cloud, log, args): ...@@ -66,7 +66,7 @@ def handle(_name, cfg, cloud, log, args):
try: try:
contents = "%s - %s - v. %s\n" % (uptime, ts, cver) contents = "%s - %s - v. %s\n" % (uptime, ts, cver)
util.write_file(boot_fin_fn, contents) util.write_file(boot_fin_fn, contents)
except: except Exception:
util.logexc(log, "Failed to write boot finished file %s", boot_fin_fn) util.logexc(log, "Failed to write boot finished file %s", boot_fin_fn)
if cloud.datasource.is_disconnected: if cloud.datasource.is_disconnected:
......
...@@ -69,5 +69,5 @@ def handle(name, cfg, _cloud, log, _args): ...@@ -69,5 +69,5 @@ def handle(name, cfg, _cloud, log, _args):
try: try:
util.subp(['debconf-set-selections'], dconf_sel) util.subp(['debconf-set-selections'], dconf_sel)
except: except Exception:
util.logexc(log, "Failed to run debconf-set-selections for grub-dpkg") util.logexc(log, "Failed to run debconf-set-selections for grub-dpkg")
...@@ -57,6 +57,6 @@ def handle(name, cfg, cloud, log, _args): ...@@ -57,6 +57,6 @@ def handle(name, cfg, cloud, log, _args):
(stdout, _stderr) = util.subp(cmd) (stdout, _stderr) = util.subp(cmd)
util.multi_log("%s\n" % (stdout.strip()), util.multi_log("%s\n" % (stdout.strip()),
stderr=False, console=True) stderr=False, console=True)
except: except Exception:
log.warn("Writing keys to the system console failed!") log.warn("Writing keys to the system console failed!")
raise raise
...@@ -111,7 +111,7 @@ def handle(name, cfg, cloud, log, args): ...@@ -111,7 +111,7 @@ def handle(name, cfg, cloud, log, args):
data = "\n".join(["set %s %s" % (k, v) data = "\n".join(["set %s %s" % (k, v)
for k, v in debconf.items()]) + "\n" for k, v in debconf.items()]) + "\n"
util.subp(['debconf-communicate'], data) util.subp(['debconf-communicate'], data)
except: except Exception:
util.logexc(log, "Failed to run '%s' for lxd with" % dconf_comm) util.logexc(log, "Failed to run '%s' for lxd with" % dconf_comm)
# Remove the existing configuration file (forces re-generation) # Remove the existing configuration file (forces re-generation)
......
...@@ -244,7 +244,7 @@ def handle_swapcfg(swapcfg): ...@@ -244,7 +244,7 @@ def handle_swapcfg(swapcfg):
LOG.debug("swap file %s already in use.", fname) LOG.debug("swap file %s already in use.", fname)
return fname return fname
LOG.debug("swap file %s existed, but not in /proc/swaps", fname) LOG.debug("swap file %s existed, but not in /proc/swaps", fname)
except: except Exception:
LOG.warn("swap file %s existed. Error reading /proc/swaps", fname) LOG.warn("swap file %s existed. Error reading /proc/swaps", fname)
return fname return fname
...@@ -379,7 +379,7 @@ def handle(_name, cfg, cloud, log, _args): ...@@ -379,7 +379,7 @@ def handle(_name, cfg, cloud, log, _args):
toks = WS.split(line) toks = WS.split(line)
if toks[3].find(comment) != -1: if toks[3].find(comment) != -1:
continue continue
except: except Exception:
pass pass
fstab_lines.append(line) fstab_lines.append(line)
...@@ -390,16 +390,16 @@ def handle(_name, cfg, cloud, log, _args): ...@@ -390,16 +390,16 @@ def handle(_name, cfg, cloud, log, _args):
if needswap: if needswap:
try: try:
util.subp(("swapon", "-a")) util.subp(("swapon", "-a"))
except: except Exception:
util.logexc(log, "Activating swap via 'swapon -a' failed") util.logexc(log, "Activating swap via 'swapon -a' failed")
for d in dirs: for d in dirs:
try: try:
util.ensure_dir(d) util.ensure_dir(d)
except: except Exception:
util.logexc(log, "Failed to make '%s' config-mount", d) util.logexc(log, "Failed to make '%s' config-mount", d)
try: try:
util.subp(("mount", "-a")) util.subp(("mount", "-a"))
except: except Exception:
util.logexc(log, "Activating mounts via 'mount -a' failed") util.logexc(log, "Activating mounts via 'mount -a' failed")
...@@ -65,7 +65,7 @@ def handle(name, cfg, cloud, log, args): ...@@ -65,7 +65,7 @@ def handle(name, cfg, cloud, log, args):
tries = ph_cfg.get('tries') tries = ph_cfg.get('tries')
try: try:
tries = int(tries) tries = int(tries)
except: except Exception:
tries = 10 tries = 10
util.logexc(log, "Configuration entry 'tries' is not an integer, " util.logexc(log, "Configuration entry 'tries' is not an integer, "
"using %s instead", tries) "using %s instead", tries)
...@@ -87,7 +87,7 @@ def handle(name, cfg, cloud, log, args): ...@@ -87,7 +87,7 @@ def handle(name, cfg, cloud, log, args):
for (n, path) in pubkeys.items(): for (n, path) in pubkeys.items():
try: try:
all_keys[n] = util.load_file(path) all_keys[n] = util.load_file(path)
except: except Exception:
util.logexc(log, "%s: failed to open, can not phone home that " util.logexc(log, "%s: failed to open, can not phone home that "
"data!", path) "data!", path)
...@@ -117,6 +117,6 @@ def handle(name, cfg, cloud, log, args): ...@@ -117,6 +117,6 @@ def handle(name, cfg, cloud, log, args):
util.read_file_or_url(url, data=real_submit_keys, util.read_file_or_url(url, data=real_submit_keys,
retries=tries, sec_between=3, retries=tries, sec_between=3,
ssl_details=util.fetch_ssl_details(cloud.paths)) ssl_details=util.fetch_ssl_details(cloud.paths))
except: except Exception:
util.logexc(log, "Failed to post phone home data to %s in %s tries", util.logexc(log, "Failed to post phone home data to %s in %s tries",
url, tries) url, tries)
...@@ -52,7 +52,7 @@ MY_HOOKNAME = 'CLOUD_INIT_REMOTE_HOOK' ...@@ -52,7 +52,7 @@ MY_HOOKNAME = 'CLOUD_INIT_REMOTE_HOOK'
def handle(name, _cfg, cloud, log, _args): def handle(name, _cfg, cloud, log, _args):
try: try:
ud = cloud.get_userdata_raw() ud = cloud.get_userdata_raw()
except: except Exception:
log.debug("Failed to get raw userdata in module %s", name) log.debug("Failed to get raw userdata in module %s", name)
return return
...@@ -63,7 +63,7 @@ def handle(name, _cfg, cloud, log, _args): ...@@ -63,7 +63,7 @@ def handle(name, _cfg, cloud, log, _args):
"did not find %s in parsed" "did not find %s in parsed"
" raw userdata"), name, MY_HOOKNAME) " raw userdata"), name, MY_HOOKNAME)
return return
except: except Exception:
util.logexc(log, "Failed to parse query string %s into a dictionary", util.logexc(log, "Failed to parse query string %s into a dictionary",
ud) ud)
raise raise
......
...@@ -34,5 +34,5 @@ def handle(name, cfg, cloud, log, _args): ...@@ -34,5 +34,5 @@ def handle(name, cfg, cloud, log, _args):
try: try:
content = util.shellify(cmd) content = util.shellify(cmd)
util.write_file(out_fn, content, 0o700) util.write_file(out_fn, content, 0o700)
except: except Exception:
util.logexc(log, "Failed to shellify %s into file %s", cmd, out_fn) util.logexc(log, "Failed to shellify %s into file %s", cmd, out_fn)
...@@ -35,7 +35,7 @@ def handle(name, _cfg, cloud, log, _args): ...@@ -35,7 +35,7 @@ def handle(name, _cfg, cloud, log, _args):
runparts_path = os.path.join(cloud.get_cpath(), 'scripts', SCRIPT_SUBDIR) runparts_path = os.path.join(cloud.get_cpath(), 'scripts', SCRIPT_SUBDIR)
try: try:
util.runparts(runparts_path) util.runparts(runparts_path)
except: except Exception:
log.warn("Failed to run module %s (%s in %s)", log.warn("Failed to run module %s (%s in %s)",
name, SCRIPT_SUBDIR, runparts_path) name, SCRIPT_SUBDIR, runparts_path)
raise raise
...@@ -35,7 +35,7 @@ def handle(name, _cfg, cloud, log, _args): ...@@ -35,7 +35,7 @@ def handle(name, _cfg, cloud, log, _args):
runparts_path = os.path.join(cloud.get_cpath(), 'scripts', SCRIPT_SUBDIR) runparts_path = os.path.join(cloud.get_cpath(), 'scripts', SCRIPT_SUBDIR)
try: try:
util.runparts(runparts_path) util.runparts(runparts_path)
except: except Exception:
log.warn("Failed to run module %s (%s in %s)", log.warn("Failed to run module %s (%s in %s)",
name, SCRIPT_SUBDIR, runparts_path) name, SCRIPT_SUBDIR, runparts_path)
raise raise
...@@ -35,7 +35,7 @@ def handle(name, _cfg, cloud, log, _args): ...@@ -35,7 +35,7 @@ def handle(name, _cfg, cloud, log, _args):
runparts_path = os.path.join(cloud.get_cpath(), 'scripts', SCRIPT_SUBDIR) runparts_path = os.path.join(cloud.get_cpath(), 'scripts', SCRIPT_SUBDIR)
try: try:
util.runparts(runparts_path) util.runparts(runparts_path)
except: except Exception:
log.warn("Failed to run module %s (%s in %s)", log.warn("Failed to run module %s (%s in %s)",
name, SCRIPT_SUBDIR, runparts_path) name, SCRIPT_SUBDIR, runparts_path)
raise raise
...@@ -36,7 +36,7 @@ def handle(name, _cfg, cloud, log, _args): ...@@ -36,7 +36,7 @@ def handle(name, _cfg, cloud, log, _args):
runparts_path = os.path.join(cloud.get_ipath_cur(), SCRIPT_SUBDIR) runparts_path = os.path.join(cloud.get_ipath_cur(), SCRIPT_SUBDIR)
try: try:
util.runparts(runparts_path) util.runparts(runparts_path)
except: except Exception:
log.warn("Failed to run module %s (%s in %s)", log.warn("Failed to run module %s (%s in %s)",
name, SCRIPT_SUBDIR, runparts_path) name, SCRIPT_SUBDIR, runparts_path)
raise raise
...@@ -37,7 +37,7 @@ def handle(name, cfg, cloud, log, _args): ...@@ -37,7 +37,7 @@ def handle(name, cfg, cloud, log, _args):
try: try:
util.runparts(runparts_path, exe_prefix=prefix) util.runparts(runparts_path, exe_prefix=prefix)
except: except Exception:
log.warn("Failed to run module %s (%s in %s)", log.warn("Failed to run module %s (%s in %s)",
name, SCRIPT_SUBDIR, runparts_path) name, SCRIPT_SUBDIR, runparts_path)
raise raise
...@@ -24,8 +24,8 @@ import os ...@@ -24,8 +24,8 @@ import os
from six import BytesIO from six import BytesIO
from cloudinit.settings import PER_INSTANCE
from cloudinit import log as logging from cloudinit import log as logging
from cloudinit.settings import PER_INSTANCE
from cloudinit import util from cloudinit import util
frequency = PER_INSTANCE frequency = PER_INSTANCE
......
...@@ -155,7 +155,7 @@ def handle(_name, cfg, cloud, log, args): ...@@ -155,7 +155,7 @@ def handle(_name, cfg, cloud, log, args):
cmd = filter(None, cmd) # Remove empty arguments cmd = filter(None, cmd) # Remove empty arguments
util.subp(cmd) util.subp(cmd)
log.debug("Restarted the ssh daemon") log.debug("Restarted the ssh daemon")
except: except Exception:
util.logexc(log, "Restarting of the ssh daemon failed") util.logexc(log, "Restarting of the ssh daemon failed")
if len(errors): if len(errors):
......
...@@ -47,12 +47,12 @@ Example config: ...@@ -47,12 +47,12 @@ Example config:
""" """
from cloudinit import log as logging from cloudinit import log as logging
from cloudinit import util
from cloudinit.settings import PER_INSTANCE from cloudinit.settings import PER_INSTANCE
from cloudinit import util
import glob import glob
import tempfile
import os import os
import tempfile
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
......
...@@ -57,7 +57,7 @@ def handle(_name, cfg, cloud, log, _args): ...@@ -57,7 +57,7 @@ def handle(_name, cfg, cloud, log, _args):
for f in glob.glob(key_pth): for f in glob.glob(key_pth):
try: try:
util.del_file(f) util.del_file(f)
except: except Exception:
util.logexc(log, "Failed deleting key file %s", f) util.logexc(log, "Failed deleting key file %s", f)
if "ssh_keys" in cfg: if "ssh_keys" in cfg:
...@@ -78,7 +78,7 @@ def handle(_name, cfg, cloud, log, _args): ...@@ -78,7 +78,7 @@ def handle(_name, cfg, cloud, log, _args):
with util.SeLinuxGuard("/etc/ssh", recursive=True): with util.SeLinuxGuard("/etc/ssh", recursive=True):
util.subp(cmd, capture=False) util.subp(cmd, capture=False)
log.debug("Generated a key for %s from %s", pair[0], pair[1]) log.debug("Generated a key for %s from %s", pair[0], pair[1])
except: except Exception:
util.logexc(log, "Failed generated a key for %s from %s", util.logexc(log, "Failed generated a key for %s from %s",
pair[0], pair[1]) pair[0], pair[1])
else: else:
...@@ -122,7 +122,7 @@ def handle(_name, cfg, cloud, log, _args): ...@@ -122,7 +122,7 @@ def handle(_name, cfg, cloud, log, _args):
keys.extend(cfgkeys) keys.extend(cfgkeys)
apply_credentials(keys, user, disable_root, disable_root_opts) apply_credentials(keys, user, disable_root, disable_root_opts)
except: except Exception:
util.logexc(log, "Applying ssh credentials failed!") util.logexc(log, "Applying ssh credentials failed!")
......
...@@ -52,14 +52,14 @@ def handle(_name, cfg, cloud, log, args): ...@@ -52,14 +52,14 @@ def handle(_name, cfg, cloud, log, args):
else: else:
try: try:
import_ids = user_cfg['ssh_import_id'] import_ids = user_cfg['ssh_import_id']
except: except Exception:
log.debug("User %s is not configured for ssh_import_id", user) log.debug("User %s is not configured for ssh_import_id", user)
continue continue
try: try:
import_ids = util.uniq_merge(import_ids) import_ids = util.uniq_merge(import_ids)
import_ids = [str(i) for i in import_ids] import_ids = [str(i) for i in import_ids]
except: except Exception:
log.debug("User %s is not correctly configured for ssh_import_id", log.debug("User %s is not correctly configured for ssh_import_id",
user) user)
continue continue
......
...@@ -40,10 +40,10 @@ It can be configured with the following option structure:: ...@@ -40,10 +40,10 @@ It can be configured with the following option structure::
mechanism you've used to switch the init system. mechanism you've used to switch the init system.
""" """
from cloudinit.settings import PER_INSTANCE from cloudinit.distros import ubuntu
from cloudinit import log as logging from cloudinit import log as logging
from cloudinit.settings import PER_INSTANCE
from cloudinit import util from cloudinit import util
from cloudinit.distros import ubuntu
import os import os
import time import time
......
...@@ -50,8 +50,8 @@ OSFAMILIES = { ...@@ -50,8 +50,8 @@ OSFAMILIES = {
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class Distro(object): class Distro(object):
__metaclass__ = abc.ABCMeta
usr_lib_exec = "/usr/lib" usr_lib_exec = "/usr/lib"
hosts_fn = "/etc/hosts" hosts_fn = "/etc/hosts"
...@@ -97,7 +97,7 @@ class Distro(object): ...@@ -97,7 +97,7 @@ class Distro(object):
try: try:
res = os.lstat('/run/systemd/system') res = os.lstat('/run/systemd/system')
return stat.S_ISDIR(res.st_mode) return stat.S_ISDIR(res.st_mode)
except: except Exception:
return False return False
@abc.abstractmethod @abc.abstractmethod
......
...@@ -25,8 +25,8 @@ import os ...@@ -25,8 +25,8 @@ import os
from cloudinit import distros from cloudinit import distros
from cloudinit import helpers from cloudinit import helpers
from cloudinit import log as logging from cloudinit import log as logging
from cloudinit import util
from cloudinit import net from cloudinit import net
from cloudinit import util
from cloudinit.distros.parsers.hostname import HostnameConf from cloudinit.distros.parsers.hostname import HostnameConf
...@@ -221,7 +221,7 @@ def _maybe_remove_legacy_eth0(path="/etc/network/interfaces.d/eth0.cfg"): ...@@ -221,7 +221,7 @@ def _maybe_remove_legacy_eth0(path="/etc/network/interfaces.d/eth0.cfg"):
msg = "removed %s with known contents" % path msg = "removed %s with known contents" % path
else: else:
msg = (bmsg + " '%s' exists with user configured content." % path) msg = (bmsg + " '%s' exists with user configured content." % path)
except: except Exception:
msg = bmsg + " %s exists, but could not be read." % path msg = bmsg + " %s exists, but could not be read." % path
LOG.warn(msg) LOG.warn(msg)
...@@ -71,8 +71,8 @@ INCLUSION_SRCH = sorted(list(INCLUSION_TYPES_MAP.keys()), ...@@ -71,8 +71,8 @@ INCLUSION_SRCH = sorted(list(INCLUSION_TYPES_MAP.keys()),
key=(lambda e: 0 - len(e))) key=(lambda e: 0 - len(e)))
@six.add_metaclass(abc.ABCMeta)
class Handler(object): class Handler(object):
__metaclass__ = abc.ABCMeta
def __init__(self, frequency, version=2): def __init__(self, frequency, version=2):
self.handler_version = version self.handler_version = version
...@@ -118,7 +118,7 @@ def run_part(mod, data, filename, payload, frequency, headers): ...@@ -118,7 +118,7 @@ def run_part(mod, data, filename, payload, frequency, headers):
mod.handle_part(data, content_type, filename, payload) mod.handle_part(data, content_type, filename, payload)
else: else:
raise ValueError("Unknown module version %s" % (mod_ver)) raise ValueError("Unknown module version %s" % (mod_ver))
except: except Exception:
util.logexc(LOG, "Failed calling handler %s (%s, %s, %s) with " util.logexc(LOG, "Failed calling handler %s (%s, %s, %s) with "
"frequency %s", mod, content_type, filename, mod_ver, "frequency %s", mod, content_type, filename, mod_ver,
frequency) frequency)
...@@ -157,7 +157,7 @@ def walker_handle_handler(pdata, _ctype, _filename, payload): ...@@ -157,7 +157,7 @@ def walker_handle_handler(pdata, _ctype, _filename, payload):
# register if it fails starting. # register if it fails starting.
handlers.register(mod, initialized=True) handlers.register(mod, initialized=True)
pdata['handlercount'] = curcount + 1 pdata['handlercount'] = curcount + 1
except: except Exception:
util.logexc(LOG, "Failed at registering python file: %s (part " util.logexc(LOG, "Failed at registering python file: %s (part "
"handler %s)", modfname, curcount) "handler %s)", modfname, curcount)
......
...@@ -158,6 +158,6 @@ class CloudConfigPartHandler(handlers.Handler): ...@@ -158,6 +158,6 @@ class CloudConfigPartHandler(handlers.Handler):
for i in ("\n", "\r", "\t"): for i in ("\n", "\r", "\t"):
filename = filename.replace(i, " ") filename = filename.replace(i, " ")
self.file_names.append(filename.strip()) self.file_names.append(filename.strip())
except: except Exception:
util.logexc(LOG, "Failed at merging in cloud config part from %s", util.logexc(LOG, "Failed at merging in cloud config part from %s",
filename) filename)
...@@ -80,7 +80,7 @@ def _has_suitable_upstart(): ...@@ -80,7 +80,7 @@ def _has_suitable_upstart():
return False return False
try: try:
(version_out, _err) = util.subp(["initctl", "version"]) (version_out, _err) = util.subp(["initctl", "version"])
except: except Exception:
util.logexc(LOG, "initctl version failed") util.logexc(LOG, "initctl version failed")
return False return False
......
...@@ -86,7 +86,7 @@ class FileSemaphores(object): ...@@ -86,7 +86,7 @@ class FileSemaphores(object):
name = canon_sem_name(name) name = canon_sem_name(name)
try: try:
yield self._acquire(name, freq) yield self._acquire(name, freq)
except: except Exception:
if clear_on_fail: if clear_on_fail:
self.clear(name, freq) self.clear(name, freq)
raise raise
...@@ -219,7 +219,7 @@ class ConfigMerger(object): ...@@ -219,7 +219,7 @@ class ConfigMerger(object):
ds_cfg = self._ds.get_config_obj() ds_cfg = self._ds.get_config_obj()
if ds_cfg and isinstance(ds_cfg, (dict)): if ds_cfg and isinstance(ds_cfg, (dict)):
d_cfgs.append(ds_cfg) d_cfgs.append(ds_cfg)
except: except Exception:
util.logexc(LOG, "Failed loading of datasource config object " util.logexc(LOG, "Failed loading of datasource config object "
"from %s", self._ds) "from %s", self._ds)
return d_cfgs return d_cfgs
...@@ -230,7 +230,7 @@ class ConfigMerger(object): ...@@ -230,7 +230,7 @@ class ConfigMerger(object):
e_fn = os.environ[CFG_ENV_NAME] e_fn = os.environ[CFG_ENV_NAME]
try: try:
e_cfgs.append(util.read_conf(e_fn)) e_cfgs.append(util.read_conf(e_fn))
except: except Exception:
util.logexc(LOG, 'Failed loading of env. config from %s', util.logexc(LOG, 'Failed loading of env. config from %s',
e_fn) e_fn)
return e_cfgs return e_cfgs
...@@ -251,7 +251,7 @@ class ConfigMerger(object): ...@@ -251,7 +251,7 @@ class ConfigMerger(object):
if cc_fn and os.path.isfile(cc_fn): if cc_fn and os.path.isfile(cc_fn):
try: try:
i_cfgs.append(util.read_conf(cc_fn)) i_cfgs.append(util.read_conf(cc_fn))
except: except Exception:
util.logexc(LOG, 'Failed loading of cloud-config from %s', util.logexc(LOG, 'Failed loading of cloud-config from %s',
cc_fn) cc_fn)
return i_cfgs return i_cfgs
...@@ -268,7 +268,7 @@ class ConfigMerger(object): ...@@ -268,7 +268,7 @@ class ConfigMerger(object):
for c_fn in self._fns: