summaryrefslogtreecommitdiff
path: root/tools/ccfg-merge-debug
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2013-04-17 09:42:55 -0700
committerScott Moser <smoser@brickies.net>2013-04-17 09:42:55 -0700
commita4ce87bedd7736d16d7102e0bb361119d1cd6359 (patch)
treed927b3c0b3686e4dad9a20869f94202cd139392b /tools/ccfg-merge-debug
parent2783ff699532d2c511cf948f4991edf351e97b65 (diff)
downloadcloud-init-a4ce87bedd7736d16d7102e0bb361119d1cd6359.tar.gz
add debug output to ccfg-merge-debug
Exeptions were being swallowed completely and no way to even see them other than log.
Diffstat (limited to 'tools/ccfg-merge-debug')
-rwxr-xr-xtools/ccfg-merge-debug8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/ccfg-merge-debug b/tools/ccfg-merge-debug
index aac60528..5b6b050a 100755
--- a/tools/ccfg-merge-debug
+++ b/tools/ccfg-merge-debug
@@ -3,6 +3,7 @@
from cloudinit import handlers
from cloudinit.handlers import cloud_config as cc_part
from cloudinit import helpers
+from cloudinit import log as logging
from cloudinit.settings import PER_INSTANCE
from cloudinit import user_data as ud
@@ -17,9 +18,16 @@ def main():
description='test cloud-config merging')
parser.add_argument("--output", "-o", metavar="file",
help="specify output file", default="-")
+ parser.add_argument('--verbose', '-v', action='count', default=0)
parser.add_argument('files', nargs='+')
args = parser.parse_args()
+
+ if args.verbose:
+ level = (logging.WARN, logging.INFO,
+ logging.DEBUG)[min(args.verbose, 2)]
+ logging.setupBasicLogging(level)
+
outfile = args.output
if args.output == "-":
outfile = "/dev/stdout"