diff options
author | Daniel Watkins <daniel.watkins@canonical.com> | 2015-03-04 15:57:41 +0000 |
---|---|---|
committer | Daniel Watkins <daniel.watkins@canonical.com> | 2015-03-04 15:57:41 +0000 |
commit | 28f8d44533ef263f7a35a9f11e328dd9035fb82a (patch) | |
tree | a33b822c9e18fc54b5a7437d1cc9ad9146deece1 /cloudinit/util.py | |
parent | 8663b57ebba7aa4f6916f53e74df4f890bbc8b9a (diff) | |
download | vyos-cloud-init-28f8d44533ef263f7a35a9f11e328dd9035fb82a.tar.gz vyos-cloud-init-28f8d44533ef263f7a35a9f11e328dd9035fb82a.zip |
Use more consistent logging invocation.
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index f95e71c8..b6065410 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -2129,22 +2129,22 @@ def _read_dmi_syspath(key): return None mapped_key = DMIDECODE_TO_DMI_SYS_MAPPING[key] dmi_key_path = "{0}/{1}".format(DMI_SYS_PATH, mapped_key) - LOG.debug("querying dmi data {0}".format(dmi_key_path)) + LOG.debug("querying dmi data %s", dmi_key_path) try: if not os.path.exists(dmi_key_path): - LOG.debug("did not find {0}".format(dmi_key_path)) + LOG.debug("did not find %s", dmi_key_path) return None key_data = load_file(dmi_key_path) if not key_data: - LOG.debug("{0} did not return any data".format(dmi_key_path)) + LOG.debug("%s did not return any data", dmi_key_path) return None - LOG.debug("dmi data {0} returned {1}".format(dmi_key_path, key_data)) + LOG.debug("dmi data %s returned %s", dmi_key_path, key_data) return key_data.strip() except Exception as e: - logexc(LOG, "failed read of {0}".format(dmi_key_path), e) + logexc(LOG, "failed read of %s", dmi_key_path, e) return None @@ -2156,10 +2156,10 @@ def _call_dmidecode(key, dmidecode_path): try: cmd = [dmidecode_path, "--string", key] (result, _err) = subp(cmd) - LOG.debug("dmidecode returned '{0}' for '{0}'".format(result, key)) + LOG.debug("dmidecode returned '%s' for '%s'", result, key) return result except (IOError, OSError) as _err: - LOG.debug('failed dmidecode cmd: {0}\n{0}'.format(cmd, _err.message)) + LOG.debug('failed dmidecode cmd: %s\n%s', cmd, _err.message) return None @@ -2184,6 +2184,6 @@ def read_dmi_data(key): if dmidecode_path: return _call_dmidecode(key, dmidecode_path) - LOG.warn("did not find either path {0} or dmidecode command".format( - DMI_SYS_PATH)) + LOG.warn("did not find either path %s or dmidecode command", + DMI_SYS_PATH) return None |