Expand cert and key path in IslandConfigOptions

This commit is contained in:
Shreya 2021-06-04 12:17:21 +05:30
parent a2bd59c377
commit 88ae762618
2 changed files with 7 additions and 2 deletions

View File

@ -45,6 +45,7 @@ DEFAULT_DEVELOP_SERVER_CONFIG_PATH = os.path.join(
) )
DEFAULT_LOG_LEVEL = "INFO" DEFAULT_LOG_LEVEL = "INFO"
DEFAULT_START_MONGO_DB = True DEFAULT_START_MONGO_DB = True
DEFAULT_CRT_PATH = str(Path(MONKEY_ISLAND_ABS_PATH, "cc", "server.crt")) DEFAULT_CRT_PATH = str(Path(MONKEY_ISLAND_ABS_PATH, "cc", "server.crt"))

View File

@ -23,5 +23,9 @@ class IslandConfigOptions:
"mongodb", {"start_mongodb": DEFAULT_START_MONGO_DB} "mongodb", {"start_mongodb": DEFAULT_START_MONGO_DB}
).get("start_mongodb", DEFAULT_START_MONGO_DB) ).get("start_mongodb", DEFAULT_START_MONGO_DB)
self.crt_path = config_contents.get("cert_path", DEFAULT_CRT_PATH) self.crt_path = os.path.expandvars(
self.key_path = config_contents.get("cert_path", DEFAULT_KEY_PATH) os.path.expanduser(config_contents.get("cert_path", DEFAULT_CRT_PATH))
)
self.key_path = os.path.expandvars(
os.path.expanduser(config_contents.get("key_path", DEFAULT_KEY_PATH))
)