From 36b3e987da6474334c90faea058a86299e379f48 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Wed, 26 May 2021 09:14:49 +0300 Subject: [PATCH] Added expand user call to transform data dir input into a proper path --- monkey/monkey_island/setup/island_config_options.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/monkey/monkey_island/setup/island_config_options.py b/monkey/monkey_island/setup/island_config_options.py index bf1c06e1b..938c840a0 100644 --- a/monkey/monkey_island/setup/island_config_options.py +++ b/monkey/monkey_island/setup/island_config_options.py @@ -1,5 +1,7 @@ from __future__ import annotations +import os + from monkey_island.cc.server_utils.consts import ( DEFAULT_DATA_DIR, DEFAULT_LOG_LEVEL, @@ -9,7 +11,7 @@ from monkey_island.cc.server_utils.consts import ( class IslandConfigOptions: def __init__(self, config_contents: dict): - self.data_dir = config_contents.get("data_dir", DEFAULT_DATA_DIR) + self.data_dir = os.path.expanduser(config_contents.get("data_dir", DEFAULT_DATA_DIR)) self.log_level = config_contents.get("log_level", DEFAULT_LOG_LEVEL)