summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceMAAS.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/sources/DataSourceMAAS.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/sources/DataSourceMAAS.py')
-rw-r--r--cloudinit/sources/DataSourceMAAS.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/cloudinit/sources/DataSourceMAAS.py b/cloudinit/sources/DataSourceMAAS.py
index 41179b02..77df5a51 100644
--- a/cloudinit/sources/DataSourceMAAS.py
+++ b/cloudinit/sources/DataSourceMAAS.py
@@ -71,7 +71,7 @@ class DataSourceMAAS(sources.DataSource):
except MAASSeedDirNone:
pass
except MAASSeedDirMalformed as exc:
- LOG.warn("%s was malformed: %s" % (self.seed_dir, exc))
+ LOG.warning("%s was malformed: %s", self.seed_dir, exc)
raise
# If there is no metadata_url, then we're not configured
@@ -107,7 +107,7 @@ class DataSourceMAAS(sources.DataSource):
try:
self.vendordata_raw = sources.convert_vendordata(vd)
except ValueError as e:
- LOG.warn("Invalid content in vendor-data: %s", e)
+ LOG.warning("Invalid content in vendor-data: %s", e)
self.vendordata_raw = None
def wait_for_metadata_service(self, url):
@@ -126,7 +126,7 @@ class DataSourceMAAS(sources.DataSource):
if timeout in mcfg:
timeout = int(mcfg.get("timeout", timeout))
except Exception:
- LOG.warn("Failed to get timeout, using %s" % timeout)
+ LOG.warning("Failed to get timeout, using %s", timeout)
starttime = time.time()
if url.endswith("/"):
@@ -190,8 +190,8 @@ def read_maas_seed_url(seed_url, read_file_or_url=None, timeout=None,
else:
md[path] = util.decode_binary(resp.contents)
else:
- LOG.warn(("Fetching from %s resulted in"
- " an invalid http code %s"), url, resp.code)
+ LOG.warning(("Fetching from %s resulted in"
+ " an invalid http code %s"), url, resp.code)
except url_helper.UrlError as e:
if e.code == 404 and not optional:
raise MAASSeedDirMalformed(