Skip to content

Commit

Permalink
bug fix for Config.get_config_value
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanneBogart committed May 16, 2024
1 parent 864634c commit d0f7962
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion skycatalogs/utils/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,13 @@ def get_config_value(self, key_path, silent=False):
d = d[i]
if not isinstance(d, dict):
raise ValueError(f'intermediate {d} is not a dict')
return d[path_items[-1]]

if path_items[-1] in d:
return d[path_items[-1]]
else:
if silent:
return None
raise ValueError(f'Item {i} not found')

def add_key(self, k, v):
'''
Expand Down

0 comments on commit d0f7962

Please sign in to comment.