Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing interface names in static_routes parser #1099

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- ios_static_routes - Add missing interface names in parser
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, lines=None, module=None):
(\svrf\s(?P<vrf>\S+))?
(\s(?P<dest>\S+))
(\s(?P<netmask>\S+))
(\s(?P<interface>(ACR|ATM-ACR|Analysis-Module|AppNav-Compress|AppNav-UnCompress|Async|Auto-Template|BD-VIF|BDI|BVI|Bluetooth|CDMA-Ix|CEM-ACR|CEM-PG|CTunnel|Container|Dialer|EsconPhy|Ethernet-Internal|Fcpa|Filter|Filtergroup|GigabitEthernet|TenGigabitEthernet|IMA-ACR|LongReachEthernet|Loopback|Lspvif|MFR|Multilink|NVI|Null|PROTECTION_GROUP|Port-channel|Portgroup|Pos-channel|SBC|SDH_ACR|SERIAL-ACR|SONET_ACR|SSLVPN-VIF|SYSCLOCK|Serial-PG|Service-Engine|TLS-VIF|Tunnel|VPN|Vif|Vir-cem-ACR|Virtual-PPP|Virtual-TokenRing)\S+))?
(\s(?P<interface>(ACR|ATM-ACR|Analysis-Module|AppNav-Compress|AppNav-UnCompress|Async|Auto-Template|BD-VIF|BDI|BVI|Bluetooth|CDMA-Ix|CEM-ACR|CEM-PG|CTunnel|Container|Dialer|EsconPhy|Ethernet-Internal|FastEthernet|Fcpa|Filter|Filtergroup|FiveGigabitEthernet|FortyGigabitEthernet|GigabitEthernet|HundredGigE|IMA-ACR|LongReachEthernet|Loopback|Lspvif|MFR|Multilink|NVI|Null|PROTECTION_GROUP|Port-channel|Portgroup|Pos-channel|SBC|SDH_ACR|SERIAL-ACR|SONET_ACR|SSLVPN-VIF|SYSCLOCK|Serial|Serial-PG|Service-Engine|TenGigabitEthernet|TLS-VIF|Tunnel|TwentyFiveGigE|TwoGigabitEthernet|VPN|Vif|Vir-cem-ACR|Virtual-PPP|Virtual-TokenRing|Vlan)\S+))?
(\s(?P<forward_router_address>(?!multicast|dhcp|global|tag|track|permanent|name)\S+))?
(\s(?P<distance_metric>\d+))?
(\stag\s(?P<tag>\d+))?
Expand Down Expand Up @@ -93,7 +93,7 @@ def __init__(self, lines=None, module=None):
(\stopology\s(?P<topology>\S+))?
(\svrf\s(?P<vrf>\S+))?
(\s(?P<dest>\S+))
(\s(?P<interface>(ACR|ATM-ACR|Analysis-Module|AppNav-Compress|AppNav-UnCompress|Async|Auto-Template|BD-VIF|BDI|BVI|Bluetooth|CDMA-Ix|CEM-ACR|CEM-PG|CTunnel|Container|Dialer|EsconPhy|Ethernet-Internal|Fcpa|Filter|Filtergroup|GigabitEthernet|IMA-ACR|LongReachEthernet|Loopback|Lspvif|MFR|Multilink|NVI|Null|PROTECTION_GROUP|Port-channel|Portgroup|Pos-channel|SBC|SDH_ACR|SERIAL-ACR|SONET_ACR|SSLVPN-VIF|SYSCLOCK|Serial-PG|Service-Engine|TLS-VIF|Tunnel|VPN|Vif|Vir-cem-ACR|Virtual-PPP|Virtual-TokenRing)\S+))?
(\s(?P<interface>(ACR|ATM-ACR|Analysis-Module|AppNav-Compress|AppNav-UnCompress|Async|Auto-Template|BD-VIF|BDI|BVI|Bluetooth|CDMA-Ix|CEM-ACR|CEM-PG|CTunnel|Container|Dialer|EsconPhy|Ethernet-Internal|FastEthernet|Fcpa|Filter|Filtergroup|FiveGigabitEthernet|FortyGigabitEthernet|GigabitEthernet|HundredGigE|IMA-ACR|LongReachEthernet|Loopback|Lspvif|MFR|Multilink|NVI|Null|PROTECTION_GROUP|Port-channel|Portgroup|Pos-channel|SBC|SDH_ACR|SERIAL-ACR|SONET_ACR|SSLVPN-VIF|SYSCLOCK|Serial|Serial-PG|Service-Engine|TenGigabitEthernet|TLS-VIF|Tunnel|TwentyFiveGigE|TwoGigabitEthernet|VPN|Vif|Vir-cem-ACR|Virtual-PPP|Virtual-TokenRing|Vlan)\S+))?
(\s(?P<forward_router_address>(?!multicast|unicast|tag|track|permanent|name)\S+))?
(\s(?P<distance_metric>\d+))?
(\s(?P<multicast>multicast))?
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/modules/network/ios/test_ios_static_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2138,6 +2138,7 @@ def test_ios_static_route_gathered(self):
self.execute_show_command.return_value = dedent(
"""\
ip route 10.0.0.0 255.0.0.0 Null0 permanent
ip route 10.10.0.0 255.255.0.0 Vlan10 10.0.0.1
ip route 192.168.1.0 255.255.255.0 GigabitEthernet0/1.22 10.0.0.1 tag 30
ip route 192.168.1.0 255.255.255.0 10.0.0.2
ip route 192.168.1.0 255.255.255.248 GigabitEthernet0/1.23 10.0.0.3 tag 30
Expand All @@ -2161,6 +2162,15 @@ def test_ios_static_route_gathered(self):
},
],
},
{
"dest": "10.10.0.0/16",
"next_hops": [
{
"forward_router_address": "10.0.0.1",
"interface": "Vlan10",
},
],
},
{
"dest": "192.168.1.0/24",
"next_hops": [
Expand Down
Loading