From b4dfba294b5697c57559b7ef3b2a6ee1c45dc1eb Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 11 May 2021 14:56:50 -0400 Subject: [PATCH] island: Pass data_dir to main() --- monkey/monkey_island.py | 2 +- monkey/monkey_island/cc/main.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island.py b/monkey/monkey_island.py index 5363ac5de..650cfe95d 100644 --- a/monkey/monkey_island.py +++ b/monkey/monkey_island.py @@ -32,4 +32,4 @@ if "__main__" == __name__: from monkey_island.cc.main import main # noqa: E402 - main(island_args.setup_only, island_args.server_config) + main(config["data_dir"], island_args.setup_only, island_args.server_config) diff --git a/monkey/monkey_island/cc/main.py b/monkey/monkey_island/cc/main.py index 5b3bfd794..4d0516d6b 100644 --- a/monkey/monkey_island/cc/main.py +++ b/monkey/monkey_island/cc/main.py @@ -34,10 +34,13 @@ from monkey_island.cc.setup import setup # noqa: E402 MINIMUM_MONGO_DB_VERSION_REQUIRED = "4.2.0" -def main(should_setup_only=False, server_config_filename=DEFAULT_SERVER_CONFIG_PATH): +def main( + data_dir, + should_setup_only=False, + server_config_filename=DEFAULT_SERVER_CONFIG_PATH, +): logger.info("Starting bootloader server") - data_dir = env_singleton.env.get_config().data_dir_abs_path env_singleton.initialize_from_file(server_config_filename) initialize_encryptor(data_dir) initialize_services(data_dir)