Update junos module utils (#58730)

*  Add utils fucntion to build xml
   subtree
This commit is contained in:
Ganesh Nalawade 2019-07-05 12:21:38 +05:30 committed by GitHub
parent 1bd91279d0
commit ff4001f470
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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