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.
This commit is contained in:
Scott Moser
2010-08-09 17:19:00 -04:00
parent 7b1caf9920
commit ea4f54dcc3
2 changed files with 2 additions and 1 deletions

View File

@@ -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)

View File

@@ -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