Skip to content
New issue

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

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

Already on GitHub? # to your account

Handle out-of-bound case where IOS splits lines #168

Closed
wants to merge 4 commits into from

Conversation

dagwieers
Copy link

@dagwieers dagwieers commented Dec 13, 2017

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT

templates/cisco_ios_show_cdp_neighbors.template

SUMMARY

So the output we got was this, which was not handled with the current textfsm template.

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
                  D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
switch01.example.com
                 Ten 2/2/8         179             R S I  WS-C4510R Ten 6/1
switch02.example.com
                 Ten 1/2/8         169             R S I  WS-C4510R Ten 5/1

So the output we got was this, which was not handled with the current textfsm template.
```
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
                  D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
sjc02-22-sw2.cisco.com
                 Ten 2/2/8         179             R S I  WS-C4510R Ten 6/1
sjc02-22-sw2.cisco.com
                 Ten 1/2/8         169             R S I  WS-C4510R Ten 5/1
```
@dagwieers dagwieers changed the title Handle out-of-bound case where ISO splits lines Handle out-of-bound case where IOS splits lines Dec 13, 2017
@itdependsnetworks
Copy link
Contributor

@dagwieers can you update the tests to reflect this use case?

Also:

I'm trying to make it a standard moving forward to add these to each template:

  ^\s+$$
  ^.* -> Error "LINE NOT FOUND"

This way if something has not known, it will fail. Having a few use cases where not finding issues that happen around 1% of the time, and hard to realize there is even an issue. Do you mind adding?

@jmcgill298
Copy link
Contributor

#235

@jmcgill298 jmcgill298 closed this Jan 21, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants