-
Notifications
You must be signed in to change notification settings - Fork 712
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
Improve cisco_ios show_lldp_neighbors_detail #1086
Improve cisco_ios show_lldp_neighbors_detail #1086
Conversation
@@ -1,5 +1,5 @@ | |||
Value LOCAL_INTERFACE (\S+) | |||
Value CHASSIS_ID (\S+) | |||
Value CHASSIS_ID ([^:]*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since matching anything not colon(:) maybe also exclude blank space ?
Should the match be nothing (*) or at least something (+) ?
e.g. ([^:\s]+)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diepes Thanks for the feedback. I've pushed a commit now using +
instead of *
.
My example in the PR wasn't very clear for this case.
The output I get from a device is:
Chassis id: S7-1200 6DS7 212-1BH40-0XB0 S V-LCCC5820 10 V 4 3 1
Do you think its valid to capture the output chassis-id as the following (including spaces)?:
S7-1200 6DS7 212-1BH40-0XB0 S V-LCCC5820 10 V 4 3 1
@@ -63,6 +70,15 @@ IgnoreDescription | |||
^\s*$$ | |||
^.* -> Error | |||
|
|||
PowerMDI | |||
^\s+Power\s+Pair:\s+${POWER_PAIR} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the variable match is at the end of the line, probably better to follow them with
\s*$$
to ensure no capture of spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @diepes I've pushed your suggested changes now.
* Improve cisco_ios show_lldp_neighbours_detail * Ensure yml file has new line at EOF * Include @diepes suggestions.
* Improve cisco_ios show_lldp_neighbours_detail * Ensure yml file has new line at EOF * Include @diepes suggestions.
resolves #919 |
ISSUE TYPE
COMPONENT
ntc_templates/templates/cisco_ios_show_lldp_neighbors_detail.textfsm
cisco_ios
show lldp neighbors details
SUMMARY
:
in the case another field is added on the same line to the ouptut in the future.