~avishai-ish-shalom/cloud-init/chef-refactor

« back to all changes in this revision

Viewing changes to tools/ccfg-merge-debug

  • Committer: Scott Moser
  • Date: 2013-04-17 16:42:55 UTC
  • Revision ID: smoser@brickies.net-20130417164255-x0fctna5cseyxcsc
add debug output to ccfg-merge-debug

Exeptions were being swallowed completely and no way to even see them
other than log.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
from cloudinit import handlers
4
4
from cloudinit.handlers import cloud_config as cc_part
5
5
from cloudinit import helpers
 
6
from cloudinit import log as logging
6
7
from cloudinit.settings import PER_INSTANCE
7
8
from cloudinit import user_data as ud
8
9
 
17
18
        description='test cloud-config merging')
18
19
    parser.add_argument("--output", "-o", metavar="file",
19
20
        help="specify output file", default="-")
 
21
    parser.add_argument('--verbose', '-v', action='count', default=0)
20
22
    parser.add_argument('files', nargs='+')
21
23
 
22
24
    args = parser.parse_args()
 
25
 
 
26
    if args.verbose:
 
27
        level = (logging.WARN, logging.INFO,
 
28
                 logging.DEBUG)[min(args.verbose, 2)]
 
29
        logging.setupBasicLogging(level)
 
30
 
23
31
    outfile = args.output
24
32
    if args.output == "-":
25
33
        outfile = "/dev/stdout"