diff --git a/distgit_bugzilla_sync/config.py b/distgit_bugzilla_sync/config.py index b87738d..004a480 100644 --- a/distgit_bugzilla_sync/config.py +++ b/distgit_bugzilla_sync/config.py @@ -15,6 +15,7 @@ # code or documentation are not subject to the GNU General Public License and # may only be used or replicated with the express permission of Red Hat, Inc. +import copy import os import toml @@ -146,6 +147,16 @@ def load_configuration(addl_config_file=None, addl_email_overrides_file=None): email_overrides.update(system_email_overrides) email_overrides.update(addl_email_overrides) + for env in config['environments'].values(): + # Fill environments with default data. + env_values = copy.deepcopy(config) + del env_values['environments'] + + # Values specified in the environments should take precedence. + env_values.update(env) + env.clear() + env.update(env_values) + config = ConfigDict() email_overrides = ConfigDict()