remove syslog handler (cruft), add debug flag

This commit is contained in:
Nico Schottelius 2019-12-31 11:56:28 +01:00
parent 4c7678618d
commit 1fba79ca31
2 changed files with 7 additions and 13 deletions

View file

@ -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()

View file

@ -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