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

Fixed TYPE regex to include non-dynamic addresses #1253

Merged
merged 3 commits into from
Dec 22, 2022
Merged

Fixed TYPE regex to include non-dynamic addresses #1253

merged 3 commits into from
Dec 22, 2022

Conversation

afly007
Copy link
Contributor

@afly007 afly007 commented Dec 20, 2022

Found a small error with MAC addresses that had type port-access-security. They weren't being processed properly by the regex.

Without the fix parsing would fail on line 5

MAC age-time            : 300 seconds
Number of MAC addresses : 104

MAC Address          VLAN     Type                      Port
--------------------------------------------------------------
00:01:00:00:00:01     1000     dynamic                   lag1
00:01:00:00:00:01     1000     dynamic                   lag1
00:01:00:00:00:01     1000     dynamic                   lag1
00:01:00:00:00:01     1000     dynamic                   lag1
00:01:00:00:00:01     2015     port-access-security      1/1/30
00:01:00:00:00:01     2015     port-access-security      1/1/27
00:01:00:00:00:01     2015     dynamic                   lag1

@@ -1,6 +1,6 @@
Value MAC (\S+)
Value VLAN (\d+)
Value TYPE ([a-z]+)
Value TYPE ([a-z-]+)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would (\S+) work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, changed to (\S+).

@itdependsnetworks
Copy link
Contributor

Can you add to the existing tests to ensure there is no regression in the future?

@itdependsnetworks itdependsnetworks merged commit 3d033d9 into networktocode:master Dec 22, 2022
@afly007 afly007 deleted the fix-aruba_aoscx_show_mac-address-table branch December 22, 2022 15:47
guillaume-mbali pushed a commit to unyc-io/ntc-templates that referenced this pull request Apr 12, 2023
* Fixed TYPE regex to include non-dynmaic addresses

* Updated TYPE regex to include non-dynmaic addresses

* Added tests for port-access-security  TYPE regex
cppmonkey pushed a commit to cppmonkey/ntc-templates that referenced this pull request Oct 25, 2023
* Fixed TYPE regex to include non-dynmaic addresses

* Updated TYPE regex to include non-dynmaic addresses

* Added tests for port-access-security  TYPE regex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants