summaryrefslogtreecommitdiff
path: root/cloudinit/handlers
diff options
context:
space:
mode:
authorJuerg Haefliger <juergh@gmail.com>2013-06-20 15:46:08 -0400
committerScott Moser <smoser@ubuntu.com>2013-06-20 15:46:08 -0400
commit852968303724c979b7a94ed69abdcff9c0e3cc93 (patch)
tree4d7a925f5f4f56d618c2d7d9b1971b0fb1a7fe08 /cloudinit/handlers
parent812f82e7b3bad3f8127face552c76ef974b54661 (diff)
parent2f853948f269f50038533782ee45e381d60d02bf (diff)
downloadvyos-cloud-init-852968303724c979b7a94ed69abdcff9c0e3cc93.tar.gz
vyos-cloud-init-852968303724c979b7a94ed69abdcff9c0e3cc93.zip
fix and tidy up logexc usage
Some of the usages of logexc contain incorrect arguments to logexc. cloudinit/config/cc_ssh_import_id.py cloudinit/distros/__init__.py The tidy up here is to fix many others that pass rendered strings to logexc rather than letting it handle rendering at a later date (or not at all in the case where logging is disabled).
Diffstat (limited to 'cloudinit/handlers')
-rw-r--r--cloudinit/handlers/__init__.py13
-rw-r--r--cloudinit/handlers/boot_hook.py4
2 files changed, 8 insertions, 9 deletions
diff --git a/cloudinit/handlers/__init__.py b/cloudinit/handlers/__init__.py
index 924463ce..497d68c5 100644
--- a/cloudinit/handlers/__init__.py
+++ b/cloudinit/handlers/__init__.py
@@ -1,7 +1,7 @@
# vi: ts=4 expandtab
#
# Copyright (C) 2012 Canonical Ltd.
-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
+# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Scott Moser <scott.moser@canonical.com>
@@ -117,10 +117,9 @@ def run_part(mod, data, filename, payload, frequency, headers):
else:
raise ValueError("Unknown module version %s" % (mod_ver))
except:
- util.logexc(LOG, ("Failed calling handler %s (%s, %s, %s)"
- " with frequency %s"),
- mod, content_type, filename,
- mod_ver, frequency)
+ util.logexc(LOG, "Failed calling handler %s (%s, %s, %s) with "
+ "frequency %s", mod, content_type, filename, mod_ver,
+ frequency)
def call_begin(mod, data, frequency):
@@ -158,8 +157,8 @@ def walker_handle_handler(pdata, _ctype, _filename, payload):
handlers.register(mod)
pdata['handlercount'] = curcount + 1
except:
- util.logexc(LOG, ("Failed at registering python file: %s"
- " (part handler %s)"), modfname, curcount)
+ util.logexc(LOG, "Failed at registering python file: %s (part "
+ "handler %s)", modfname, curcount)
def _extract_first_or_bytes(blob, size):
diff --git a/cloudinit/handlers/boot_hook.py b/cloudinit/handlers/boot_hook.py
index bf2899ab..11ac4fe5 100644
--- a/cloudinit/handlers/boot_hook.py
+++ b/cloudinit/handlers/boot_hook.py
@@ -70,5 +70,5 @@ class BootHookPartHandler(handlers.Handler):
except util.ProcessExecutionError:
util.logexc(LOG, "Boothooks script %s execution error", filepath)
except Exception:
- util.logexc(LOG, ("Boothooks unknown "
- "error when running %s"), filepath)
+ util.logexc(LOG, "Boothooks unknown error when running %s",
+ filepath)