show running-config interface {interface} parser not getting acl name on IOS/IOS-XE
See original GitHub issueThe following parser commands don’t return the correct output for ‘acl’ if access-list is only configured in either ‘in’ or ‘out’ direction on interface:
"show running-config | section ^interface"
"show running-config interface {interface_name}"
See details below:
Output of parser for “show running-config | section ^interface”:
- If access-list is only configured in ‘in’ direction:
interface GigabitEthernet1/0/27
ip access-group TEST in
Then parser returns an empty acl:
'GigabitEthernet1/0/27': {'acl': {}}
But the expected result is:
'GigabitEthernet1/0/27': {'acl': {'inbound': {'acl_name': 'TEST', 'direction': 'in'}}}
- If access-list is only configured in ‘out’ direction:
interface GigabitEthernet1/0/28
ip access-group TEST out
Then parser returns an acl:
'GigabitEthernet1/0/28': {'acl': {'inbound': {'acl_name': 'TEST', 'direction': 'in'}, 'outbound': {'acl_name': 'TEST', 'direction': 'out'}}}
But the expected result is:
'GigabitEthernet1/0/28': {'acl': {'outbound': {'acl_name': 'TEST', 'direction': 'out'}}}
Output of parser for “show running-config interface GigabitEthernet1/0/27”
{'interfaces': {'GigabitEthernet1/0/27': {'acl': {}}}}
Output of parser for “show running-config interface GigabitEthernet1/0/28”
File "src/genie/conf/base/device.py", line 527, in genie.conf.base.device.Device.parse
File "src/genie/conf/base/device.py", line 566, in genie.conf.base.device.Device._get_parser_output
File "src/genie/conf/base/device.py", line 564, in genie.conf.base.device.Device._get_parser_output
File "src/genie/metaparser/_metaparser.py", line 308, in genie.metaparser._metaparser.MetaParser.parse
File "/scripts/venv-pycrawler/lib/python3.10/site-packages/genie/libs/parser/iosxe/show_run.py", line 1311, in cli
intf_dict['acl'].update(inbound_dict)
UnboundLocalError: local variable 'inbound_dict' referenced before assignment
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Thank you, after upgrade of pyATS/genie to 22.6 I confirm that parser works fine and produces expected results for all my tests
It’s been fixed and will be released in 22.6