diff --git a/ush/python_utils/config_parser.py b/ush/python_utils/config_parser.py index 5619cf2197..2d74762285 100644 --- a/ush/python_utils/config_parser.py +++ b/ush/python_utils/config_parser.py @@ -407,7 +407,10 @@ def xml_to_dict(root, return_string): cfg[k] = value else: cfg_l = {} - if value is None: + cfg_l.update({"attrib": child.attrib}) + if isinstance(value, dict): + cfg_l.update(value) + elif value is None: cfg_l.update({"attrib": child.attrib}) else: cfg_l.update({"attrib": child.attrib, "valuea": value}) @@ -441,7 +444,7 @@ def dict_to_xml(d, elem): if isinstance(va, dict): dict_to_xml(va, child) else: - child.text = list_to_str(v, True) + child.text = list_to_str(va, True) elem.append(child) else: child = ET.Element(k)