apply defaults to environments
Signed-off-by: Nils Philippsen <nils@redhat.com>
This commit is contained in:
parent
c71b3cc0ad
commit
41ca605dde
1 changed files with 11 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue