island: Simplify logic in add_default_values_to_config()

This commit is contained in:
Mike Salvatore 2021-05-11 13:29:53 -04:00
parent de7865aa21
commit 5ea241f120
1 changed files with 3 additions and 4 deletions

View File

@ -17,10 +17,9 @@ def load_server_config_from_file(server_config_path):
def add_default_values_to_config(config):
config["data_dir"] = os.path.abspath(
os.path.expanduser(
os.path.expandvars(config["data_dir"] if "data_dir" in config else DEFAULT_DATA_DIR)
)
os.path.expanduser(os.path.expandvars(config.get("data_dir", DEFAULT_DATA_DIR)))
)
config["log_level"] = config["log_level"] if "log_level" in config else DEFAULT_LOG_LEVEL
config.setdefault("log_level", DEFAULT_LOG_LEVEL)
return config