diff --git a/lib/ansible/modules/network/cloudengine/ce_vrf.py b/lib/ansible/modules/network/cloudengine/ce_vrf.py index b6f6a90b8e..9daad302e0 100644 --- a/lib/ansible/modules/network/cloudengine/ce_vrf.py +++ b/lib/ansible/modules/network/cloudengine/ce_vrf.py @@ -214,7 +214,7 @@ class Vrf(object): root = ElementTree.fromstring(xml_str) vpn_instances = root.findall( - "data/l3vpn/l3vpncomm/l3vpnInstances/l3vpnInstance") + "l3vpn/l3vpncomm/l3vpnInstances/l3vpnInstance") if vpn_instances: for vpn_instance in vpn_instances: if vpn_instance.find('vrfName').text == self.vrf: diff --git a/lib/ansible/modules/network/cloudengine/ce_vrf_af.py b/lib/ansible/modules/network/cloudengine/ce_vrf_af.py index f6de1e6f63..c019e1af8d 100644 --- a/lib/ansible/modules/network/cloudengine/ce_vrf_af.py +++ b/lib/ansible/modules/network/cloudengine/ce_vrf_af.py @@ -568,7 +568,7 @@ class VrfAf(object): # get the vpn address family and RD text vrf_addr_types = root.findall( - "data/l3vpn/l3vpncomm/l3vpnInstances/l3vpnInstance/vpnInstAFs/vpnInstAF") + "l3vpn/l3vpncomm/l3vpnInstances/l3vpnInstance/vpnInstAFs/vpnInstAF") if vrf_addr_types: for vrf_addr_type in vrf_addr_types: vrf_af_info = dict() diff --git a/lib/ansible/modules/network/cloudengine/ce_vrf_interface.py b/lib/ansible/modules/network/cloudengine/ce_vrf_interface.py index bed004c0d9..681e9934e4 100644 --- a/lib/ansible/modules/network/cloudengine/ce_vrf_interface.py +++ b/lib/ansible/modules/network/cloudengine/ce_vrf_interface.py @@ -353,7 +353,7 @@ class VrfInterface(object): for l3vpn_ifinfo in l3vpn_if: for ele in l3vpn_ifinfo: if ele.tag in ['ifName']: - if ele.text == self.vpn_interface: + if ele.text.lower() == self.vpn_interface.lower(): self.intf_info['vrfName'] = vpn_name def get_interface_vpn(self): @@ -371,14 +371,13 @@ class VrfInterface(object): # get global vrf interface info root = ElementTree.fromstring(xml_str) vpns = root.findall( - "data/l3vpn/l3vpncomm/l3vpnInstances/l3vpnInstance") + "l3vpn/l3vpncomm/l3vpnInstances/l3vpnInstance") if vpns: for vpnele in vpns: vpn_name = None for vpninfo in vpnele: if vpninfo.tag == 'vrfName': vpn_name = vpninfo.text - if vpninfo.tag == 'l3vpnIfs': self.get_interface_vpn_name(vpninfo, vpn_name) @@ -408,7 +407,7 @@ class VrfInterface(object): replace('xmlns="http://www.huawei.com/netconf/vrp"', "") root = ElementTree.fromstring(xml_str) - interface = root.find("data/ifm/interfaces/interface") + interface = root.find("ifm/interfaces/interface") if interface: for eles in interface: if eles.tag in ["isL2SwitchPort"]: