From 7541dab1ef64dd64266dd25f69bb826dd109507f Mon Sep 17 00:00:00 2001 From: Xu Yuandong Date: Thu, 19 Sep 2019 17:15:48 +0800 Subject: [PATCH] update to fix a bug. (#62417) --- .../modules/network/cloudengine/ce_link_status.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ansible/modules/network/cloudengine/ce_link_status.py b/lib/ansible/modules/network/cloudengine/ce_link_status.py index 56899fd6789..93ea0528e7c 100644 --- a/lib/ansible/modules/network/cloudengine/ce_link_status.py +++ b/lib/ansible/modules/network/cloudengine/ce_link_status.py @@ -55,7 +55,7 @@ notes: options: interface: description: - - For the interface parameter, you can enter C(all) to display information about all interface, + - For the interface parameter, you can enter C(all) to display information about all interfaces, an interface type such as C(40GE) to display information about interfaces of the specified type, or full name of an interface such as C(40GE1/0/22) or C(vlanif10) to display information about the specific interface. @@ -88,7 +88,7 @@ EXAMPLES = ''' interface: 40GE provider: "{{ cli }}" - - name: Get all interface link status information + - name: Get all interfaces link status information ce_link_status: interface: all provider: "{{ cli }}" @@ -128,7 +128,7 @@ result: from xml.etree import ElementTree from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.network.cloudengine.ce import ce_argument_spec, get_nc_config +from ansible.module_utils.network.cloudengine.ce import ce_argument_spec, get_nc_config, get_nc_next CE_NC_GET_PORT_SPEED = """ @@ -393,10 +393,10 @@ class LinkStatus(object): 'Outbound rate(pkts/sec)'] = eles.text def get_all_interface_info(self, intf_type=None): - """Get interface information all or by interface type""" + """Get interface information by all or by interface type""" xml_str = CE_NC_GET_INT_STATISTICS % '' - con_obj = get_nc_config(self.module, xml_str) + con_obj = get_nc_next(self.module, xml_str) if "" in con_obj: return @@ -406,7 +406,7 @@ class LinkStatus(object): # get link status information root = ElementTree.fromstring(xml_str) - intfs_info = root.find("ifm/interfaces") + intfs_info = root.findall("ifm/interfaces/interface") if not intfs_info: return