Update junos module utils (#58730)
* Add utils fucntion to build xml subtree
This commit is contained in:
parent
1bd91279d0
commit
ff4001f470
1 changed files with 8 additions and 0 deletions
|
@ -27,6 +27,14 @@ def build_child_xml_node(parent, tag, text=None, attrib=None):
|
|||
return element
|
||||
|
||||
|
||||
def build_subtree(parent, path):
|
||||
element = parent
|
||||
for field in path.split('/'):
|
||||
sub_element = build_child_xml_node(element, field)
|
||||
element = sub_element
|
||||
return element
|
||||
|
||||
|
||||
def _handle_field_replace(root, field, have, want, tag=None):
|
||||
tag = field if not tag else tag
|
||||
want_value = want.get(field) if want else None
|
||||
|
|
Loading…
Reference in a new issue