From ae17f3842ef1567807a1e0791a0e11e223bfc3a1 Mon Sep 17 00:00:00 2001 From: YuandongXu <786018072@qq.com> Date: Tue, 9 Jul 2019 12:43:09 +0800 Subject: [PATCH] Backport/2.8/58230 ce_link_status: update to fix a bug (#58230) (#58561) * update to fix a bug (#58230) (cherry picked from commit b7630ccb363d28f7a76bf93db803e5535dab5968) * add a changelog fragment. --- .../fragments/58561-update-ce_link_status-to-fix-a-bug.yml | 2 ++ lib/ansible/modules/network/cloudengine/ce_link_status.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/58561-update-ce_link_status-to-fix-a-bug.yml diff --git a/changelogs/fragments/58561-update-ce_link_status-to-fix-a-bug.yml b/changelogs/fragments/58561-update-ce_link_status-to-fix-a-bug.yml new file mode 100644 index 0000000000..9ebf5292a7 --- /dev/null +++ b/changelogs/fragments/58561-update-ce_link_status-to-fix-a-bug.yml @@ -0,0 +1,2 @@ +bugfixes: + - ce_link_status - remove the 'data' tag to fix a bug,.(https://github.com/ansible/ansible/pull/58229) \ No newline at end of file diff --git a/lib/ansible/modules/network/cloudengine/ce_link_status.py b/lib/ansible/modules/network/cloudengine/ce_link_status.py index 936c247e4b..56899fd678 100644 --- a/lib/ansible/modules/network/cloudengine/ce_link_status.py +++ b/lib/ansible/modules/network/cloudengine/ce_link_status.py @@ -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":