-
Notifications
You must be signed in to change notification settings - Fork 784
Add juniper junos show ethernet-switching interfaces #2263
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
base: master
Are you sure you want to change the base?
Add juniper junos show ethernet-switching interfaces #2263
Conversation
Use the normalized VLAN_ID capture group name for the VLAN tag.
Make the ethernet-switching regex pattern match another existing command (where there are optional characters for the shortened version.)
|
@clement-ldr
Note to self: |
| ^${INTERFACE}\s+${STATUS}\s+${VLAN_MEMBER}\s+${TAGGING}\s+${PORT_ERROR} | ||
| ^${INTERFACE}\s+${STATUS}\s+${VLAN_MEMBER}\s+${PORT_ERROR} | ||
| ^\s+${VLAN_MEMBER}\s+${VLAN_ID}\s+${TAGGING}\s+${PORT_ERROR} | ||
| ^{.*}$$ |
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.
@clement-ldr What is the ^{.*}$$ regex intended to match?
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.
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.
For example :
user@switch> show ethernet-switching interfaces
Interface State VLAN members Tag Tagging Blocking
ae2.0 up itx-s45-1 10 tagged unblocked
itx-s45-1-adm 20 tagged unblocked
l2rpn 4001 tagged unblocked
bme0.32770 down mgmt untagged unblocked
me0.0 down mgmt untagged unblocked
{master:0}
user@switch>
{master:0}
user@switch>
{master:0}
user@switch>
{master:0} may be something else like {backup}, its more part of the the prompt though so im not sure its needed or if raising an error is better?
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.
Thats intended to match the
{master:0}routing engine info juniper print before the user prompt. its part of the prompt but may get mixed with the command body and somme templates have it, idk if its really needed.
Ah, gotcha.
I wouldn't have guessed that unless I stumbled on another template or its raw cli data. 😅
If the word varies from master some of the time then we could use a regex.
Would this ^{\S+:\d+}$$ be a viable alternative?
Update: From your output above, I wouldn't think we should see {master:0} in the output. It's not clear if it appears at the tail end after a command or following a carriage return.
If there are templates without a line/rule for this type of pattern then we probably don't need it. (I haven't checked all the junos templates.)
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.
There are some templates without it and napalm.cli does not return it (netmiko probably does the same) I think we can remove it fine 👍
Edit:
Removed in b051cc7
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.
There are some templates without it and napalm.cli does not return it (netmiko probably does the same) I think we can remove it fine 👍
Ah, your mention about NAPALM and Netmiko made me realize that I looked into those lines a while back. For example, Netmiko strips those {master:0} strings before returning the output.
I suppose it's ok though if someone is parsing output retrieved using some other library or means (that doesn't remove those strings) then it's a potential wrinkle.
New template to add support for juniper junos
show ethernet-switching interfaces🤠