summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_mounts.py
diff options
context:
space:
mode:
authorJoshua Powers <josh.powers@canonical.com>2017-04-06 11:14:29 -0700
committerScott Moser <smoser@ubuntu.com>2017-04-21 10:14:47 -0400
commit5afe4cd0797a12d07ea19b9715b720d47bdea401 (patch)
tree8be9e7b623002b1fd60fb21b95696ab6b67ca497 /cloudinit/config/cc_mounts.py
parent33816e96d8981918f734dab3ee1a967bce85451a (diff)
downloadvyos-cloud-init-5afe4cd0797a12d07ea19b9715b720d47bdea401.tar.gz
vyos-cloud-init-5afe4cd0797a12d07ea19b9715b720d47bdea401.zip
pylint: fix all logging warnings
This will change all instances of LOG.warn to LOG.warning as warn is now a deprecated method. It will also make sure any logging uses lazy logging by passing string format arguments as function parameters.
Diffstat (limited to 'cloudinit/config/cc_mounts.py')
-rw-r--r--cloudinit/config/cc_mounts.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py
index 5b630f8b..f14a4fc5 100644
--- a/cloudinit/config/cc_mounts.py
+++ b/cloudinit/config/cc_mounts.py
@@ -216,8 +216,9 @@ def suggested_swapsize(memsize=None, maxsize=None, fsys=None):
else:
pinfo[k] = v
- LOG.debug("suggest %(size)s swap for %(mem)s memory with '%(avail)s'"
- " disk given max=%(max_in)s [max=%(max)s]'" % pinfo)
+ LOG.debug("suggest %s swap for %s memory with '%s'"
+ " disk given max=%s [max=%s]'", pinfo['size'], pinfo['mem'],
+ pinfo['avail'], pinfo['max_in'], pinfo['max'])
return size
@@ -266,7 +267,7 @@ def handle_swapcfg(swapcfg):
return None or (filename, size)
"""
if not isinstance(swapcfg, dict):
- LOG.warn("input for swap config was not a dict.")
+ LOG.warning("input for swap config was not a dict.")
return None
fname = swapcfg.get('filename', '/swap.img')
@@ -289,7 +290,8 @@ def handle_swapcfg(swapcfg):
return fname
LOG.debug("swap file %s existed, but not in /proc/swaps", fname)
except Exception:
- LOG.warn("swap file %s existed. Error reading /proc/swaps", fname)
+ LOG.warning("swap file %s existed. Error reading /proc/swaps",
+ fname)
return fname
try:
@@ -300,7 +302,7 @@ def handle_swapcfg(swapcfg):
return setup_swapfile(fname=fname, size=size, maxsize=maxsize)
except Exception as e:
- LOG.warn("failed to setup swap: %s", e)
+ LOG.warning("failed to setup swap: %s", e)
return None