help='Increase verbosity level for debugging (multiple allowed)') options, args = parser.parse_args() return options, args parser = OptionParser() options, args = parse_args(parser) ch = ConfigHolder(config_file_name=options.config_file, verbosity=options.verbosity) initialize_logger(ch.get(defaults.CONFIG_MAIN_SECTION, 'log_direction'), ch.verbosity) if options.action in VALID_ACTIONS: if len(args) < VALID_ACTIONS[options.action]: print_detail("Insufficient argument provided (%d required)" % VALID_ACTIONS[options.action]) parser.print_help() abort("") else: if options.action: print_detail("Invalid action requested (%s)\n" % options.action) else: print_detail("No action specified\n") parser.print_help() abort("") backend_proxy = PdiskBackendProxyFactory.createBackendProxy(ch) # Execute requested action status = 0
def debug(self, msg, level=0): print_detail(msg, level)
def debug(self, level, msg): print_detail(msg, level)
action='count', default=defaults.VERBOSITY, help='Increase verbosity level for debugging (multiple allowed)') options, args = parser.parse_args() return options, args parser = OptionParser() options, args = parse_args(parser) ch = ConfigHolder(config_file_name=options.config_file, verbosity=options.verbosity) initialize_logger(ch.get(defaults.CONFIG_MAIN_SECTION, 'log_direction'), ch.verbosity) if options.action in VALID_ACTIONS: if len(args) < VALID_ACTIONS[options.action]: print_detail("Insufficient argument provided (%d required)" % VALID_ACTIONS[options.action]) parser.print_help() abort("") else: if options.action: print_detail("Invalid action requested (%s)\n" % options.action) else: print_detail("No action specified\n") parser.print_help() abort("") backend_proxy = PdiskBackendProxyFactory.createBackendProxy(ch) # Execute requested action status = 0