forked from uncloud/uncloud
remove syslog handler (cruft), add debug flag
This commit is contained in:
parent
4c7678618d
commit
1fba79ca31
2 changed files with 7 additions and 13 deletions
|
@ -22,32 +22,26 @@ sys.excepthook = exception_hook
|
|||
if __name__ == '__main__':
|
||||
# Setting up root logger
|
||||
logger = logging.getLogger()
|
||||
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
syslog_handler = SysLogHandler(address='/dev/log')
|
||||
syslog_handler.setLevel(logging.DEBUG)
|
||||
syslog_formatter = logging.Formatter('%(pathname)s:%(lineno)d -- %(levelname)-8s %(message)s')
|
||||
syslog_handler.setFormatter(syslog_formatter)
|
||||
|
||||
logger.addHandler(syslog_handler)
|
||||
parent_parser = argparse.ArgumentParser(add_help=False)
|
||||
parent_parser.add_argument("--debug", "-d", action='store_true')
|
||||
|
||||
arg_parser = argparse.ArgumentParser()
|
||||
|
||||
subparsers = arg_parser.add_subparsers(dest="command")
|
||||
|
||||
api_parser = subparsers.add_parser("api")
|
||||
|
||||
api_parser = subparsers.add_parser("api", parents=[parent_parser])
|
||||
host_parser = subparsers.add_parser("host")
|
||||
host_parser.add_argument("--hostname", required=True)
|
||||
|
||||
scheduler_parser = subparsers.add_parser("scheduler")
|
||||
|
||||
filescanner_parser = subparsers.add_parser("filescanner")
|
||||
|
||||
imagescanner_parser = subparsers.add_parser("imagescanner")
|
||||
|
||||
metadata_parser = subparsers.add_parser("metadata")
|
||||
|
||||
config_parser = subparsers.add_parser("configure")
|
||||
|
||||
configure_parser(config_parser)
|
||||
args = arg_parser.parse_args()
|
||||
|
||||
|
|
|
@ -561,7 +561,7 @@ api.add_resource(ListHost, "/host/list")
|
|||
api.add_resource(CreateNetwork, "/network/create")
|
||||
|
||||
|
||||
def main():
|
||||
def main(debug=False):
|
||||
image_stores = list(
|
||||
shared.etcd_client.get_prefix(
|
||||
settings["etcd"]["image_store_prefix"], value_in_json=True
|
||||
|
|
Loading…
Reference in a new issue