From 6f2f34bb39880228802a1b4c78c945a4675209e0 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 9 Aug 2010 17:19:00 -0400 Subject: cloud-init-cfg: log warning with traceback on failure of a config module Previously, all you would get was a warning to the console on config module failure. This changes to get a stack trace of the failure to the console, which is much easier for debugging. --- cloud-init-cfg.py | 2 ++ cloudinit/CloudConfig/__init__.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cloud-init-cfg.py b/cloud-init-cfg.py index c29efd92..eb875182 100755 --- a/cloud-init-cfg.py +++ b/cloud-init-cfg.py @@ -22,6 +22,7 @@ import cloudinit import cloudinit.CloudConfig import logging import os +import traceback def Usage(out = sys.stdout): out.write("Usage: %s name\n" % sys.argv[0]) @@ -95,6 +96,7 @@ def main(): (name, freq, run_args )) cc.handle(name, run_args, freq=freq) except: + log.warn(traceback.format_exc()) err("config handling of %s, %s, %s failed\n" % (name,freq,run_args), log) failures.append(name) diff --git a/cloudinit/CloudConfig/__init__.py b/cloudinit/CloudConfig/__init__.py index 874f8d0a..c8d3e96f 100644 --- a/cloudinit/CloudConfig/__init__.py +++ b/cloudinit/CloudConfig/__init__.py @@ -56,6 +56,5 @@ class CloudConfig(): self.cloud.sem_and_run("config-" + name, freq, handler, [ name, self.cfg, self.cloud, cloudinit.log, args ]) except: - cloudinit.log.debug(traceback.format_exc()) raise -- cgit v1.2.3