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

Captured Administrative Mode, added support for unassigned Access VLAN #552

Closed
wants to merge 1 commit into from

Conversation

jmorello12
Copy link
Contributor

ISSUE TYPE
  • New Template Pull Request
COMPONENT

Template: cisco_ios_show_interfaces_switchport.textfsm
OS: Cisco IOS
Command: show interfaces switchport

SUMMARY

Added a capture group for "Administrative Mode" and added support for the case where Access VLAN is unassigned.

Before:
{'interface': 'Gi9/10', 'switchport': 'Enabled', 'switchport_monitor': '', 'switchport_negotiation': 'Off', 'mode': 'down', 'access_vlan': '267', 'native_vlan': '1', 'voice_vlan': '1267', 'trunking_vlans': 'ALL'}

After:
{'interface': 'Gi9/10', 'switchport': 'Enabled', 'switchport_monitor': '', 'switchport_negotiation': 'Off', 'mode': 'down', 'admin_mode': 'static access', 'access_vlan': '267', 'native_vlan': '1', 'voice_vlan': '1267', 'trunking_vlans': 'ALL'}

@jmcgill298 jmcgill298 added changes_requested Waiting on user to address feedback enhancement labels Dec 4, 2019
Copy link
Contributor

@jmcgill298 jmcgill298 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmorello12 Please also update the test files in tests/cisco_ios/show_interfaces_switchport/

Copy link
Contributor

@jmcgill298 jmcgill298 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to update regex to ensure trailing whitespace is stripped

@@ -3,7 +3,8 @@ Value SWITCHPORT (.+)
Value SWITCHPORT_MONITOR (.+)
Value SWITCHPORT_NEGOTIATION (.+)
Value MODE (.+)
Value ACCESS_VLAN (\d+)
Value ADMIN_MODE (.+)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Value ADMIN_MODE (.+)
Value ADMIN_MODE (.+?)

@@ -19,7 +20,7 @@ Start
^\s*Trunking\s+Native\s+Mode\s+VLAN:\s+${NATIVE_VLAN}
^\s*Voice\s+VLAN:\s+${VOICE_VLAN}
^\s*Trunking\s+VLANs\s+Enabled:\s+${TRUNKING_VLANS}
^\s*Administrative\s+Mode
^\s*Administrative\s+Mode:\s+${ADMIN_MODE}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
^\s*Administrative\s+Mode:\s+${ADMIN_MODE}
^\s*Administrative\s+Mode:\s+${ADMIN_MODE}\s*$$

@FragmentedPacket
Copy link
Contributor

@jmorello12 Do you mind addressing @jmcgill298's feedback? We can get it merged in once the necessary changes are made.

@jmcgill298 jmcgill298 closed this Dec 20, 2019
@jmcgill298
Copy link
Contributor

#563

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes_requested Waiting on user to address feedback enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants