Pass file paths to setup_certificate() instead of IslandConfigOptions

This commit is contained in:
Shreya 2021-06-07 20:10:25 +05:30
parent 42a9a79800
commit 4f601ca5dc
2 changed files with 2 additions and 6 deletions

View File

@ -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()

View File

@ -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)