Added expand user call to transform data dir input into a proper path

This commit is contained in:
VakarisZ 2021-05-26 09:14:49 +03:00
parent 559b61b581
commit 36b3e987da
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
from __future__ import annotations from __future__ import annotations
import os
from monkey_island.cc.server_utils.consts import ( from monkey_island.cc.server_utils.consts import (
DEFAULT_DATA_DIR, DEFAULT_DATA_DIR,
DEFAULT_LOG_LEVEL, DEFAULT_LOG_LEVEL,
@ -9,7 +11,7 @@ from monkey_island.cc.server_utils.consts import (
class IslandConfigOptions: class IslandConfigOptions:
def __init__(self, config_contents: dict): 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) self.log_level = config_contents.get("log_level", DEFAULT_LOG_LEVEL)