-
Notifications
You must be signed in to change notification settings - Fork 742
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
Created cisco_xr_show_bgp_vrf_all_neighbors_advertised-routes.textfsm #1907
Conversation
cisco_xr_show_ipv4_interface.textfsm, .*, cisco_xr, sh[[ow]] ip[[v4]](?: vrf \S+)? int[[erface]] can now serve both "show ipv4 interface" and "show ipv4 vrf interface" commands
Added fields of interest: Secondary IP address Secondary IP prefix lenght VRF ID Output ACL Input ACL RPF Check
Test file with values for secondary IP and mask lenght, access list, RPF
ntc_templates/templates/cisco_xr_show_bgp_vrf_all_neighbors_advertised-routes.textfsm
Outdated
Show resolved
Hide resolved
…vertised-routes.textfsm Co-authored-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
…vertised-routes.textfsm Co-authored-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
|
||
ROUTES | ||
^${NETWORK}\/${PREFIX_LENGTH}\s+${NEXT_HOP}\s+${FROM}\s+${AS_PATH} -> Record | ||
^\s*$$ -> End |
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.
I see what you did here, haha.
Hopscotch right to the End
once you see a blank line. 😁
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.
Way easier to finish the job :-)
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 is a disadvantage though in that once the first blank line is hit then it goes straight to jail, err End
. (Monopoly joke 😆)
I would say jumping to End
in this manner may not be desirable though in the long term.
😁 As long as it is ok with @jmcgill298 and the other maintainers then I suppose that's fine.
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.
ya, I'm not sure what this buys us, it seems there is just one more line to catch, so it should be easy enough to look for ^Processed
. We will also need to have an NVM, I just missed that^. -> Error
line in this section too.
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.
Given the syntax on lots of other templates, my $0.02 is not to redirect to end and instead handle the lines.
Allowing this state redirect to End
does not align with the project requirement of matching all lines.
I'm wrong, technically the blank line is matched as is Processed.
Is there an advantage of redirecting to End
rather than just matching it and being done with the line at that point? I'm inclined to say keep it simple and there's little sense in explicitly redirecting to End
.
(Granted there are non-compliant templates from before that project requirement, but those will have to be retroactively identified. Holiday wish list [err, to-do list 😆] of sorts, haha.)
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.
Looking into it.
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.
How do you generate the YML files from the JSON output? I am using nornir.tech to convert from JSON to YML. But after I have to check cases, spacing...
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.
@jorlandobr
There are development helper scripts you can use.
I have a fix for the blank entry that I'll be submitting shortly.
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.
The helper scripts, I don't find it. To access them should I use git and download the project to my local machine?
I can't use git at work. Will try this at home.
The blank fix worked!
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.
The helper scripts, I don't find it. To access them should I use git and download the project to my local machine?
@jorlandobr
Yeah, git clone
your fork, switch to your branches where you're developing and run the helper script(s).
I can't use git at work. Will try this at home.
You might be able to use GitHub Codespaces from your browser, but there are "core hours" limits per month based on plans. When you're not using your Codespace, you can stop it here (or delete it when you're done with it).
I was able to get the below to function in case it is of use to you.
# Go to your fork repo and choose the branch you're working on
# Click on the green Code button > Codespaces tab > Create codespace on <branch_name>
# Codespace launches in a new web browser tab
# From the VS Code Terminal
git switch <your_branch_name>
poetry shell
poetry install
# nothing but an example, hehe
python cli.py gen-yaml-folder -f tests/cisco_xr/show_ip_bgp_summary/
💡 Don't forget to conserve your Codespace hours by stopping it here (or delete it when you're done with it).
The blank fix worked!
💯 😁
Yep, thank you, thank you, haha. 🙇
|
||
ROUTES | ||
^${NETWORK}\/${PREFIX_LENGTH}\s+${NEXT_HOP}\s+${FROM}\s+${AS_PATH} -> Record | ||
^\s*$$ -> End |
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.
ya, I'm not sure what this buys us, it seems there is just one more line to catch, so it should be easy enough to look for ^Processed
. We will also need to have an NVM, I just missed that^. -> Error
line in this section too.
ntc_templates/templates/cisco_xr_show_bgp_vrf_all_neighbors_advertised-routes.textfsm
Outdated
Show resolved
Hide resolved
…vertised-routes.textfsm Co-authored-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
ntc_templates/templates/cisco_xr_show_bgp_vrf_all_neighbors_advertised-routes.textfsm
Outdated
Show resolved
Hide resolved
…vertised-routes.textfsm Co-authored-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
ntc_templates/templates/cisco_xr_show_bgp_vrf_all_neighbors_advertised-routes.textfsm
Outdated
Show resolved
Hide resolved
…vertised-routes.textfsm Co-authored-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
ntc_templates/templates/cisco_xr_show_bgp_vrf_all_neighbors_advertised-routes.textfsm
Outdated
Show resolved
Hide resolved
@jorlandobr This documentation on workflow and branching might be helpful too. It's generally a pain to develop on one's primary branch (ex: |
…vertised-routes.textfsm Co-authored-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
Thanks for your help! I'll start to learn this new tool :-) |
ntc_templates/templates/cisco_xr_show_bgp_vrf_all_neighbors_advertised-routes.textfsm
Outdated
Show resolved
Hide resolved
…vertised-routes.textfsm
ntc_templates/templates/cisco_xr_show_bgp_vrf_all_neighbors_advertised-routes.textfsm
Outdated
Show resolved
Hide resolved
…vertised-routes.textfsm
ntc_templates/templates/cisco_xr_show_bgp_vrf_all_neighbors_advertised-routes.textfsm
Outdated
Show resolved
Hide resolved
…vertised-routes.textfsm
Added new template
cisco_xr_show_bgp_vrf_all_neighbors_advertised-routes
. Included test case andIndex
modification.