summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-05-24 17:58:18 +0200
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-05-24 17:58:18 +0200
commit81156aa423309c72f17709eea994e7e06ebc431c (patch)
tree4ee78fb024c5f03a3c12e39e1adfc1b0cb84063b /cloudinit/util.py
parent14040a9c8df6e8406acb79fd653873bb05cb4d40 (diff)
parentea4bc2c603a9d964a918e01d00e39a851e979830 (diff)
downloadvyos-cloud-init-81156aa423309c72f17709eea994e7e06ebc431c.tar.gz
vyos-cloud-init-81156aa423309c72f17709eea994e7e06ebc431c.zip
rebased with upstream and reolved merge conflicts
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r--cloudinit/util.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index 0773af69..d6b80dbe 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -288,7 +288,7 @@ def fork_cb(child_cb, *args, **kwargs):
try:
child_cb(*args, **kwargs)
os._exit(0)
- except:
+ except Exception:
logexc(LOG, "Failed forking and calling callback %s",
type_utils.obj_name(child_cb))
os._exit(1)
@@ -482,7 +482,7 @@ def is_ipv4(instr):
try:
toks = [x for x in toks if int(x) < 256 and int(x) >= 0]
- except:
+ except Exception:
return False
return len(toks) == 4
@@ -1220,7 +1220,7 @@ def get_cmdline():
else:
try:
cmdline = load_file("/proc/cmdline").strip()
- except:
+ except Exception:
cmdline = ""
PROC_CMDLINE = cmdline
@@ -1390,7 +1390,7 @@ def read_write_cmdline_url(target_fn):
if not os.path.exists(target_fn):
try:
(key, url, content) = get_cmdline_url()
- except:
+ except Exception:
logexc(LOG, "Failed fetching command line url")
return
try:
@@ -1401,7 +1401,7 @@ def read_write_cmdline_url(target_fn):
elif key and not content:
LOG.debug(("Command line key %s with url"
" %s had no contents"), key, url)
- except:
+ except Exception:
logexc(LOG, "Failed writing url content to %s", target_fn)
@@ -1459,7 +1459,7 @@ def mounts():
mp = m.group(2)
fstype = m.group(3)
opts = m.group(4)
- except:
+ except Exception:
continue
# If the name of the mount point contains spaces these
# can be escaped as '\040', so undo that..
@@ -1585,7 +1585,7 @@ def copy(src, dest):
def time_rfc2822():
try:
ts = time.strftime("%a, %d %b %Y %H:%M:%S %z", time.gmtime())
- except:
+ except Exception:
ts = "??"
return ts
@@ -1611,7 +1611,7 @@ def uptime():
bootup = buf.value
uptime_str = now - bootup
- except:
+ except Exception:
logexc(LOG, "Unable to read uptime using method: %s" % method)
return uptime_str
@@ -2065,7 +2065,7 @@ def log_time(logfunc, msg, func, args=None, kwargs=None, get_uptime=False):
tmsg += " (N/A)"
try:
logfunc(msg + tmsg)
- except:
+ except Exception:
pass
return ret