Backport/2.8/58230 ce_link_status: update to fix a bug (#58230) (#58561)

* update to fix a bug (#58230)


(cherry picked from commit b7630ccb36)

* add a changelog fragment.
This commit is contained in:
YuandongXu 2019-07-09 12:43:09 +08:00 committed by Toshio Kuratomi
parent eb9f6ce790
commit ae17f3842e
2 changed files with 5 additions and 3 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- ce_link_status - remove the 'data' tag to fix a bug,.(https://github.com/ansible/ansible/pull/58229)

View file

@ -406,7 +406,7 @@ class LinkStatus(object):
# get link status information
root = ElementTree.fromstring(xml_str)
intfs_info = root.find("data/ifm/interfaces")
intfs_info = root.find("ifm/interfaces")
if not intfs_info:
return
@ -452,7 +452,7 @@ class LinkStatus(object):
# get link status information
root = ElementTree.fromstring(xml_str)
intf_info = root.find("data/ifm/interfaces/interface")
intf_info = root.find("ifm/interfaces/interface")
if intf_info:
for eles in intf_info:
if eles.tag in ["ifDynamicInfo", "ifStatistics", "ifClearedStat"]:
@ -508,7 +508,7 @@ class LinkStatus(object):
# get link status information
root = ElementTree.fromstring(xml_str)
port_info = root.find("data/devm/ports/port")
port_info = root.find("devm/ports/port")
if port_info:
for eles in port_info:
if eles.tag == "ethernetPort":