From 4f601ca5dc57593ef1f159ede7caa142c42236f3 Mon Sep 17 00:00:00 2001 From: Shreya Date: Mon, 7 Jun 2021 20:10:25 +0530 Subject: [PATCH] Pass file paths to setup_certificate() instead of IslandConfigOptions --- monkey/monkey_island/cc/server_setup.py | 2 +- monkey/monkey_island/cc/setup/certificate_setup.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/monkey/monkey_island/cc/server_setup.py b/monkey/monkey_island/cc/server_setup.py index fbd61982a..63918f567 100644 --- a/monkey/monkey_island/cc/server_setup.py +++ b/monkey/monkey_island/cc/server_setup.py @@ -83,7 +83,7 @@ def _start_island_server(should_setup_only, config_options: IslandConfigOptions) populate_exporter_list() app = init_app(MONGO_URL) - crt_path, key_path = setup_certificate(config_options) + crt_path, key_path = setup_certificate(config_options.crt_path, config_options.key_path) init_collections() diff --git a/monkey/monkey_island/cc/setup/certificate_setup.py b/monkey/monkey_island/cc/setup/certificate_setup.py index 1eaab4f04..273bbee1b 100644 --- a/monkey/monkey_island/cc/setup/certificate_setup.py +++ b/monkey/monkey_island/cc/setup/certificate_setup.py @@ -4,15 +4,11 @@ from monkey_island.cc.services.utils.file_handling import ( ensure_file_existence, ensure_file_permissions, ) -from monkey_island.cc.setup.island_config_options import IslandConfigOptions logger = logging.getLogger(__name__) -def setup_certificate(config_options: IslandConfigOptions) -> (str, str): - crt_path = config_options.crt_path - key_path = config_options.key_path - +def setup_certificate(crt_path: str, key_path: str) -> (str, str): for file in [crt_path, key_path]: ensure_file_existence(file) ensure_file_permissions(file)