ansible-collections / cisco.iosxr

Ansible Network Collection for Cisco IOSXR
GNU General Public License v3.0
67 stars 47 forks source link

iosxr_l2_interfaces and iosxr_l3_interfaces - 'NoneType' object has no attribute 'group' #452

Closed antoinekh closed 10 months ago

antoinekh commented 10 months ago
SUMMARY

Issue on both iosxr_l2_interfaces and iosxr_l3_interfaces with error 'NoneType' object has no attribute 'group'

ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
ansible 2.10.8
  config file = /home/antoine/ansible_backbone/ansible.cfg
  configured module search path = ['/home/antoine/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
COLLECTION VERSION
# /usr/lib/python3/dist-packages/ansible_collections
Collection  Version
----------- -------
cisco.iosxr 1.2.1  

# /home/antoine/.ansible/collections/ansible_collections
Collection  Version
----------- -------
cisco.iosxr 6.1.0  
CONFIGURATION
DEFAULT_FORKS(/home/antoine/ansible_backbone/ansible.cfg) = 30
DEFAULT_HOST_LIST(/home/antoine/ansible_backbone/ansible.cfg) = ['/home/antoine/ansible_backbone/hosts']
DEFAULT_STDOUT_CALLBACK(/home/antoine/ansible_backbone/ansible.cfg) = debug
DEPRECATION_WARNINGS(/home/antoine/ansible_backbone/ansible.cfg) = False
HOST_KEY_CHECKING(/home/antoine/ansible_backbone/ansible.cfg) = False
INTERPRETER_PYTHON(/home/antoine/ansible_backbone/ansible.cfg) = /usr/bin/python3
SYSTEM_WARNINGS(/home/antoine/ansible_backbone/ansible.cfg) = False
OS / ENVIRONMENT

Ansible on a VM linux Target iosxr routers cisco n540-24z8q2c-m

RP/0/RP0/CPU0:rti-mpls-scl03#show version
Fri Nov 17 12:20:10.982 GMT-2
Cisco IOS XR Software, Version 7.4.2
Copyright (c) 2013-2022 by Cisco Systems, Inc.

Build Information:
 Built By     : ingunawa
 Built On     : Wed Feb 16 05:24:50 PST 2022
 Built Host   : iox-lnx-025
 Workspace    : /auto/srcarchive15/prod/7.4.2/ncs540/ws
 Version      : 7.4.2
 Location     : /opt/cisco/XR/packages/
 Label        : 7.4.2

cisco NCS-540 () processor
System uptime is 1 year 12 weeks 11 hours 29 minutes
STEPS TO REPRODUCE
- name: Gathered L3 interfaces
  cisco.iosxr.iosxr_l3_interfaces:
    state: gathered
  register: l3_interfaces
  tags: [l3_interfaces]

OR

- name: Gathered L2 interfaces
  cisco.iosxr.iosxr_l2_interfaces:
    state: gathered
  register: l2_interfaces
EXPECTED RESULTS

No errors on gathered

ACTUAL RESULTS
task path: /home/antoine/ansible_backbone/tasks/25_iosxr_interfaces.yml:21
The full traceback is:
  File "/home/antoine/.ansible/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/facts/facts.py", line 128, in get_network_resources_facts
    inst.populate_facts(self._connection, self.ansible_facts, data)
  File "/home/antoine/.ansible/collections/ansible_collections/cisco/iosxr/plugins/module_utils/network/iosxr/facts/l3_interfaces/l3_interfaces.py", line 70, in populate_facts
    obj = self.render_config(self.generated_spec, conf)
  File "/home/antoine/.ansible/collections/ansible_collections/cisco/iosxr/plugins/module_utils/network/iosxr/facts/l3_interfaces/l3_interfaces.py", line 98, in render_config
    intf = match.group(1)
fatal: [rti-mpls-vdm04]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "config": null,
            "running_config": null,
            "state": "gathered"
        }
    }
}

MSG:

'NoneType' object has no attribute 'group'
ashwini-mhatre commented 10 months ago

@antoinekh Could you please share output of "show running-config interfaces" command?

antoinekh commented 10 months ago

Hello, Here the command "show running-config interface" (without the S because it is not a known command).

show_running-config_interface.txt

ashwini-mhatre commented 10 months ago

issue is fixed