diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-04-05 00:30:28 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-04-05 00:30:28 -0400 |
commit | 6d62fe860f55faf2d7b0b6216c11305e114c5214 (patch) | |
tree | 1ced1a31ef311cdd0cfcb6ee6eb43371416d8e21 | |
parent | 9258ae52432ab73acef139e38b930faba4858bc8 (diff) | |
download | vyos-cloud-init-6d62fe860f55faf2d7b0b6216c11305e114c5214.tar.gz vyos-cloud-init-6d62fe860f55faf2d7b0b6216c11305e114c5214.zip |
add a better exception message
-rwxr-xr-x | cloud-init.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cloud-init.py b/cloud-init.py index 08be1e0c..3261e3f3 100755 --- a/cloud-init.py +++ b/cloud-init.py @@ -76,8 +76,10 @@ def main(): if os.path.exists(target): cmdline_msg = "cmdline: %s existed" % target else: + cmdline=util.get_cmdline() try: - (key, url, content) = cloudinit.get_cmdline_url() + (key, url, content) = cloudinit.get_cmdline_url( + cmdline=cmdline) if key and content: util.write_file(target, content, mode=0600) cmdline_msg = ("cmdline: wrote %s from %s, %s" % @@ -86,7 +88,8 @@ def main(): cmdline_msg = ("cmdline: %s, %s had no cloud-config" % (key, url)) except Exception: - cmdline_exc = traceback.format_exc() + cmdline_exc = ("cmdline: '%s' raised exception\n%s" % + (cmdline, traceback.format_exc())) warn(cmdline_exc) try: |