Skip to content

Commit

Permalink
Fix config normalization for dictionary and list variables
Browse files Browse the repository at this point in the history
  • Loading branch information
khizunov committed Dec 26, 2023
1 parent 6f03833 commit 9c0f32c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions skipper/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ def load_defaults():

def _normalize_config(config, normalized_config):
for key, value in six.iteritems(config):
normalized_key = key.replace('-', '_')
if isinstance(value, dict):
normalized_config[key] = {}
_normalize_config(value, normalized_config[key])
normalized_config[normalized_key] = {}
_normalize_config(value, normalized_config[normalized_key])
elif isinstance(value, list):
normalized_config[key] = [_interpolate_env_vars(x) for x in value]
normalized_config[normalized_key] = [_interpolate_env_vars(x) for x in value]
else:
normalized_key = key.replace('-', '_')
normalized_config[normalized_key] = _interpolate_env_vars(value)


Expand Down

0 comments on commit 9c0f32c

Please sign in to comment.