Merge pull request '2022.6.12 - Alle Umgebungsvariablen' (#74) from 2022.6.12 into 2022.6

Reviewed-on: #74
Closes #73
This commit is contained in:
Sven Heidemann 2022-05-24 17:39:20 +02:00
commit cf305aeebb

View File

@ -200,10 +200,11 @@ class Configuration(ConfigurationABC):
self._additional_arguments.append(arg_str)
def add_environment_variables(self, prefix: str):
for variable in ConfigurationVariableNameEnum.to_list():
var_name = f'{prefix}{variable}'
if var_name in [key.upper() for key in os.environ.keys()]:
self._set_variable(variable, os.environ[var_name])
for env_var in os.environ.keys():
if not env_var.startswith(prefix):
continue
self._set_variable(env_var.replace(prefix, ''), os.environ[env_var])
def add_console_argument(self, argument: ArgumentABC):
self._argument_types.append(argument)