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

hp_comware_display_interface_brief.textfsm failing on Duplex value #1949

Open
juliencorsini opened this issue Dec 26, 2024 · 2 comments · May be fixed by #1964
Open

hp_comware_display_interface_brief.textfsm failing on Duplex value #1949

juliencorsini opened this issue Dec 26, 2024 · 2 comments · May be fixed by #1964

Comments

@juliencorsini
Copy link

juliencorsini commented Dec 26, 2024

ISSUE TYPE
  • Template Issue with error and raw data
TEMPLATE USING
Value INTERFACE (\S+)
Value LINK (\S+)
Value PROTOCOL ((?:UP|DOWN)(?:\(s\))?)
Value MAIN_IP (\S+)
Value SPEED (\S+)
Value DUPLEX (A|H|F)
Value TYPE (A|T|H)
Value PVID (\d+)
Value DESCRIPTION (.*?)

Start
  ^\s*The\s+brief\s+information\s+of\s+interface\(s\)\s+under\s+route\s+mode:\s*$$
  ^\s*Link:\s+ADM\s+-\s+administratively\s+down;\s+Stby\s+-\s+standby\s*$$
  ^\s*Protocol:\s+\(s\)\s+-\s+spoofing\s*$$
  ^\s*Interface\s+Link\s+Protocol\s+Main\s+IP\s+Description\s*$$ -> RouteModeIfaces
  ^\s*The\s+brief\s+information\s+of\s+interface\(s\)\s+under\s+bridge\s+mode:\s*$$
  ^\s*Link:\s+ADM\s+-\s+administratively\s+down;\s+Stby\s+-\s+standby\s*$$
  ^\s*Speed\s+or\s+Duplex:\s+\(a\)/A\s+-\s+auto;\s+H\s+-\s+half;\s+F\s+-\s+full\s*$$
  ^\s*Type:\s+A\s+-\s+access;\s+T\s+-\s+trunk;\s+H\s+-\s+hybrid\s*$$
  ^\s*Interface\s+Link\s+Speed\s+Duplex\s+Type\s+PVID\s+Description\s*$$ -> BridgeModeIfaces
  ^\s*$$
  ^. -> Error

RouteModeIfaces
  ^\s*${INTERFACE}\s+${LINK}\s+${PROTOCOL}\s+${MAIN_IP}(?:\s+${DESCRIPTION})?\s*$$ -> Record
  ^\s*$$ -> Start
  ^. -> Error

BridgeModeIfaces
  ^${INTERFACE}\s+${LINK}\s+${SPEED}\s+${DUPLEX}\s+${TYPE}\s+${PVID}(?:\s+${DESCRIPTION})?\s*$$ -> Record
  ^\s*$$
  ^. -> Error
SAMPLE COMMAND OUTPUT
The brief information of interface(s) under route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface            Link Protocol Main IP         Description
M-GE0/0/0            ADM  DOWN     --
NULL0                UP   UP(s)    --
Vlan1081             UP   UP       1.2.3.6
The brief information of interface(s) under bridge mode:
Link: ADM - administratively down; Stby - standby
Speed or Duplex: (a)/A - auto; H - half; F - full
Type: A - access; T - trunk; H - hybrid
Interface            Link Speed   Duplex Type PVID Description
BAGG10               UP   20G(a)  F(a)   T    4094 mydescr
BAGG11               UP   20G(a)  F(a)   T    4094 mydescr
SUMMARY

The Duplex value is set to (A|H|F). In a real life scenario, when ports are autoneg, the duplex output is something like F(a).
The template works perfectly well when value of DUPLEX is set to \S+

@juliencorsini juliencorsini changed the title hp_comware_display_interface_brief.textfsm hp_comware_display_interface_brief.textfsm failing on Duplex value Dec 26, 2024
@mjbear
Copy link
Contributor

mjbear commented Dec 26, 2024

@juliencorsini
Would you edit the description and put the Template and Sample text in code fences?

Edit: It may also be advisable to re-copy the raw CLI output and paste in the code fences so that you're sure the whitespace is correct.

Are you interested in submitting a pull request for template modifications?

juliencorsini added a commit to juliencorsini/ntc-templates that referenced this issue Jan 7, 2025
Fixed regexp of hp_comware_display_interface_brief.textfsm for duplex value.
Fixes networktocode#1949
@juliencorsini
Copy link
Author

Hi @mjbear

Thanks for your reply and sorry for the issues with presentation, I'm afraid I'm not too familiar with good practices.

I pushed a PR for this.

mjbear pushed a commit to mjbear/ntc-templates that referenced this issue Jan 7, 2025
Fixed regexp of hp_comware_display_interface_brief.textfsm for duplex value.
Fixes networktocode#1949
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 a pull request may close this issue.

2 participants