summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceAzure.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/DataSourceAzure.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/DataSourceAzure.py')
-rw-r--r--cloudinit/sources/DataSourceAzure.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
index 48a3e1df..04358b73 100644
--- a/cloudinit/sources/DataSourceAzure.py
+++ b/cloudinit/sources/DataSourceAzure.py
@@ -116,7 +116,7 @@ class DataSourceAzureNet(sources.DataSource):
# the metadata and "bounce" the network to force DDNS to update via
# dhclient
azure_hostname = self.metadata.get('local-hostname')
- LOG.debug("Hostname in metadata is {}".format(azure_hostname))
+ LOG.debug("Hostname in metadata is %s", azure_hostname)
hostname_command = self.ds_cfg['hostname_bounce']['hostname_command']
with temporary_hostname(azure_hostname, self.ds_cfg,
@@ -132,7 +132,7 @@ class DataSourceAzureNet(sources.DataSource):
cfg=cfg,
prev_hostname=previous_hostname)
except Exception as e:
- LOG.warn("Failed publishing hostname: %s", e)
+ LOG.warning("Failed publishing hostname: %s", e)
util.logexc(LOG, "handling set_hostname failed")
def get_metadata_from_agent(self):
@@ -168,7 +168,7 @@ class DataSourceAzureNet(sources.DataSource):
func=wait_for_files,
args=(fp_files,))
if len(missing):
- LOG.warn("Did not find files, but going on: %s", missing)
+ LOG.warning("Did not find files, but going on: %s", missing)
metadata = {}
metadata['public-keys'] = key_value or pubkeys_from_crt_files(fp_files)
@@ -199,7 +199,7 @@ class DataSourceAzureNet(sources.DataSource):
except BrokenAzureDataSource as exc:
raise exc
except util.MountFailedError:
- LOG.warn("%s was not mountable", cdev)
+ LOG.warning("%s was not mountable", cdev)
continue
(md, self.userdata_raw, cfg, files) = ret
@@ -331,8 +331,8 @@ def address_ephemeral_resize(devpath=RESOURCE_DISK_PATH, maxwait=120,
log_pre="Azure ephemeral disk: ")
if missing:
- LOG.warn("ephemeral device '%s' did not appear after %d seconds.",
- devpath, maxwait)
+ LOG.warning("ephemeral device '%s' did not appear after %d seconds.",
+ devpath, maxwait)
return
result = False
@@ -342,7 +342,7 @@ def address_ephemeral_resize(devpath=RESOURCE_DISK_PATH, maxwait=120,
else:
result, msg = can_dev_be_reformatted(devpath)
- LOG.debug("reformattable=%s: %s" % (result, msg))
+ LOG.debug("reformattable=%s: %s", result, msg)
if not result:
return
@@ -355,7 +355,7 @@ def address_ephemeral_resize(devpath=RESOURCE_DISK_PATH, maxwait=120,
LOG.debug(bmsg + " removed.")
except Exception as e:
# python3 throws FileNotFoundError, python2 throws OSError
- LOG.warn(bmsg + ": remove failed! (%s)" % e)
+ LOG.warning(bmsg + ": remove failed! (%s)", e)
else:
LOG.debug(bmsg + " did not exist.")
return
@@ -405,7 +405,7 @@ def pubkeys_from_crt_files(flist):
errors.append(fname)
if errors:
- LOG.warn("failed to convert the crt files to pubkey: %s", errors)
+ LOG.warning("failed to convert the crt files to pubkey: %s", errors)
return pubkeys
@@ -427,8 +427,8 @@ def wait_for_files(flist, maxwait=60, naplen=.5, log_pre=""):
time.sleep(naplen)
waited += naplen
- LOG.warn("%sStill missing files after %s seconds: %s",
- log_pre, maxwait, need)
+ LOG.warning("%sStill missing files after %s seconds: %s",
+ log_pre, maxwait, need)
return need