Island: Reorder function calls in run_monkey_island()

Configuration options should be validated before they are used.
This commit is contained in:
Mike Salvatore 2022-08-12 11:46:16 -04:00
parent 09f6cce6de
commit 0c39268668
1 changed files with 4 additions and 3 deletions

View File

@ -47,16 +47,17 @@ logger = logging.getLogger(__name__)
def run_monkey_island(): def run_monkey_island():
island_args = parse_cli_args() island_args = parse_cli_args()
config_options = _extract_config(island_args) config_options = _extract_config(island_args)
_setup_data_dir(config_options.data_dir)
_exit_on_invalid_config_options(config_options) _exit_on_invalid_config_options(config_options)
_setup_data_dir(config_options.data_dir)
_configure_logging(config_options) _configure_logging(config_options)
ip_addresses, deployment, version = _collect_system_info() ip_addresses, deployment, version = _collect_system_info()
_send_analytics(deployment, version) _send_analytics(deployment, version)
container = _initialize_di_container(ip_addresses, version, config_options.data_dir) container = _initialize_di_container(ip_addresses, version, config_options.data_dir)
_initialize_mongodb_connection(config_options.start_mongodb, config_options.data_dir)
_initialize_mongodb_connection(config_options.start_mongodb, config_options.data_dir)
_start_island_server(island_args.setup_only, config_options, container) _start_island_server(island_args.setup_only, config_options, container)