From 8b3703816d191c9e77060c2733149df7e111165e Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 10 Feb 2021 12:40:18 -0500 Subject: [PATCH] run black to format monkey_island.py --- monkey/monkey_island.py | 44 ++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/monkey/monkey_island.py b/monkey/monkey_island.py index 224b4788f..ea8c96efd 100644 --- a/monkey/monkey_island.py +++ b/monkey/monkey_island.py @@ -5,25 +5,40 @@ gevent_monkey.patch_all() import json # noqa: E402 from monkey_island.cc.main import main # noqa: E402 -from monkey_island.cc.consts import DEFAULT_SERVER_CONFIG_PATH, DEFAULT_LOGGING_CONFIG_PATH # noqa: E402 +from monkey_island.cc.consts import ( + DEFAULT_SERVER_CONFIG_PATH, + DEFAULT_LOGGING_CONFIG_PATH, +) # noqa: E402 from monkey_island.cc.island_logger import json_setup_logging # noqa: E402 def parse_cli_args(): import argparse - parser = argparse.ArgumentParser(description="Infection Monkey Island CnC Server. See https://infectionmonkey.com", - formatter_class=argparse.ArgumentDefaultsHelpFormatter) - parser.add_argument("-s", "--setup-only", action="store_true", - help="Pass this flag to cause the Island to setup and exit without actually starting. " - "This is useful for preparing Island to boot faster later-on, so for " - "compiling/packaging Islands.") - parser.add_argument("--server-config", action="store", - help="The path to the server configuration file.", - default=DEFAULT_SERVER_CONFIG_PATH) - parser.add_argument("--logging-config", action="store", - help="The path to the logging configuration file.", - default=DEFAULT_LOGGING_CONFIG_PATH) + parser = argparse.ArgumentParser( + description="Infection Monkey Island CnC Server. See https://infectionmonkey.com", + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + ) + parser.add_argument( + "-s", + "--setup-only", + action="store_true", + help="Pass this flag to cause the Island to setup and exit without actually starting. " + "This is useful for preparing Island to boot faster later-on, so for " + "compiling/packaging Islands.", + ) + parser.add_argument( + "--server-config", + action="store", + help="The path to the server configuration file.", + default=DEFAULT_SERVER_CONFIG_PATH, + ) + parser.add_argument( + "--logging-config", + action="store", + help="The path to the logging configuration file.", + default=DEFAULT_LOGGING_CONFIG_PATH, + ) args = parser.parse_args() return (args.setup_only, args.server_config, args.logging_config) @@ -36,9 +51,10 @@ if "__main__" == __name__: # imports, so the log init needs to be first. try: json_setup_logging(logging_config) - except(json.JSONDecodeError) as ex: + except (json.JSONDecodeError) as ex: print(f"Error loading logging config: {ex}") exit(1) from monkey_island.cc.main import main + main(is_setup_only, server_config)