diff options
author | Joshua Powers <josh.powers@canonical.com> | 2017-04-06 11:14:29 -0700 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2017-04-21 10:14:47 -0400 |
commit | 5afe4cd0797a12d07ea19b9715b720d47bdea401 (patch) | |
tree | 8be9e7b623002b1fd60fb21b95696ab6b67ca497 /cloudinit/cmd/main.py | |
parent | 33816e96d8981918f734dab3ee1a967bce85451a (diff) | |
download | vyos-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/cmd/main.py')
-rw-r--r-- | cloudinit/cmd/main.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/cloudinit/cmd/main.py b/cloudinit/cmd/main.py index fd221323..26cc2654 100644 --- a/cloudinit/cmd/main.py +++ b/cloudinit/cmd/main.py @@ -405,7 +405,8 @@ def main_init(name, args): errfmt_orig = errfmt (outfmt, errfmt) = util.get_output_cfg(mods.cfg, name) if outfmt_orig != outfmt or errfmt_orig != errfmt: - LOG.warn("Stdout, stderr changing to (%s, %s)", outfmt, errfmt) + LOG.warning("Stdout, stderr changing to (%s, %s)", + outfmt, errfmt) (outfmt, errfmt) = util.fixup_output(mods.cfg, name) except Exception: util.logexc(LOG, "Failed to re-adjust output redirection!") @@ -427,15 +428,15 @@ def di_report_warn(datasource, cfg): dicfg = cfg.get('di_report', {}) if not isinstance(dicfg, dict): - LOG.warn("di_report config not a dictionary: %s", dicfg) + LOG.warning("di_report config not a dictionary: %s", dicfg) return dslist = dicfg.get('datasource_list') if dslist is None: - LOG.warn("no 'datasource_list' found in di_report.") + LOG.warning("no 'datasource_list' found in di_report.") return elif not isinstance(dslist, list): - LOG.warn("di_report/datasource_list not a list: %s", dslist) + LOG.warning("di_report/datasource_list not a list: %s", dslist) return # ds.__module__ is like cloudinit.sources.DataSourceName @@ -444,8 +445,8 @@ def di_report_warn(datasource, cfg): if modname.startswith(sources.DS_PREFIX): modname = modname[len(sources.DS_PREFIX):] else: - LOG.warn("Datasource '%s' came from unexpected module '%s'.", - datasource, modname) + LOG.warning("Datasource '%s' came from unexpected module '%s'.", + datasource, modname) if modname in dslist: LOG.debug("used datasource '%s' from '%s' was in di_report's list: %s", @@ -571,10 +572,10 @@ def main_single(name, args): mod_args, mod_freq) if failures: - LOG.warn("Ran %s but it failed!", mod_name) + LOG.warning("Ran %s but it failed!", mod_name) return 1 elif not which_ran: - LOG.warn("Did not run %s, does it exist?", mod_name) + LOG.warning("Did not run %s, does it exist?", mod_name) return 1 else: # Guess it worked |