1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Repare debug log

This commit is contained in:
Julien Duponchelle 2015-02-02 21:28:09 +01:00
parent aecd7dedba
commit 2c3fe2ad4b
2 changed files with 13 additions and 9 deletions

View File

@ -85,6 +85,11 @@ def parse_arguments():
parser.add_argument("-d", "--debug", action="store_true", help="show debug logs and enable code live reload") parser.add_argument("-d", "--debug", action="store_true", help="show debug logs and enable code live reload")
args = parser.parse_args() args = parser.parse_args()
return args
def set_config(args):
config = Config.instance() config = Config.instance()
server_config = config.get_section_config("Server") server_config = config.get_section_config("Server")
server_config["local"] = server_config.get("local", "true" if args.local else "false") server_config["local"] = server_config.get("local", "true" if args.local else "false")
@ -97,26 +102,25 @@ def parse_arguments():
server_config["debug"] = server_config.get("debug", "true" if args.debug else "false") server_config["debug"] = server_config.get("debug", "true" if args.debug else "false")
config.set_section_config("Server", server_config) config.set_section_config("Server", server_config)
return args
def main(): def main():
""" """
Entry point for GNS3 server Entry point for GNS3 server
""" """
# We init the logger with info level during config file parsing
user_log = init_logger(logging.INFO)
user_log.info("GNS3 server version {}".format(__version__))
current_year = datetime.date.today().year
user_log.info("Copyright (c) 2007-{} GNS3 Technologies Inc.".format(current_year))
level = logging.INFO level = logging.INFO
args = parse_arguments() args = parse_arguments()
if args.debug: if args.debug:
level = logging.DEBUG level = logging.DEBUG
user_log = init_logger(level, quiet=args.quiet) user_log = init_logger(level, quiet=args.quiet)
user_log = init_logger(logging.INFO)
user_log.info("GNS3 server version {}".format(__version__))
current_year = datetime.date.today().year
user_log.info("Copyright (c) 2007-{} GNS3 Technologies Inc.".format(current_year))
set_config(args)
server_config = Config.instance().get_section_config("Server") server_config = Config.instance().get_section_config("Server")
if server_config.getboolean("local"): if server_config.getboolean("local"):
log.warning("Local mode is enabled. Beware, clients will have full control on your filesystem") log.warning("Local mode is enabled. Beware, clients will have full control on your filesystem")

View File

@ -28,7 +28,7 @@ PROJECT_CREATE_SCHEMA = {
}, },
"uuid": { "uuid": {
"description": "Project UUID", "description": "Project UUID",
"type": "string", "type": ["string", "null"],
"minLength": 36, "minLength": 36,
"maxLength": 36, "maxLength": 36,
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"