Skip to content

Commit

Permalink
Fix merge error when keys missing in config (#819)
Browse files Browse the repository at this point in the history
  • Loading branch information
hwikle-lanl authored Feb 18, 2025
1 parent f0b7956 commit 395d8d5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/yaml_config/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ def get_sub_comments(self, show_choices, show_name):

def merge(self, old, new):

if old is None:
return new

base = old.copy()

if new is None:
Expand All @@ -422,7 +425,7 @@ def merge(self, old, new):
old[key], value)
elif value is not None:
try:
base[key] = self.config_elems[key].merge(old[key], new[key])
base[key] = self.config_elems[key].merge(old.get(key), new[key])
except:
raise

Expand Down Expand Up @@ -788,6 +791,10 @@ def validate(self, value, partial=False):
return out_dict

def merge(self, old, new):

if old is None:
return new

base = old.copy()

if new is None:
Expand Down

0 comments on commit 395d8d5

Please sign in to comment.