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

Fix regex and both for import and export route-targets NXOS #843

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------
* NXOS
* Modified ShowRunningConfigVrf:
* Updated regex pattern <p5> to include : match for route-target
* Updated so 'both' is used when route-target is imported and exported. (Already done the same way for IOS XE 'show vrf detail')
7 changes: 5 additions & 2 deletions src/genie/libs/parser/nxos/show_vrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def cli(self, vrf=None):
# route-target both auto
# route-target both auto mvpn
# route-target both auto evpn
p5 = re.compile(r'^\s*route-target +(?P<rt_type>\w+) +(?P<rt>\w+)( +(?P<rt_evpn_mvpn>\w+))?$')
p5 = re.compile(r'^\s*route-target +(?P<rt_type>\w+) +(?P<rt>\w+:\w+)( +(?P<rt_evpn_mvpn>\w+))?$')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add comment for the regex change

Copy link
Author

@BingPB BingPB Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but I'm not sure what comment to add, since it should have been like this from the start.
Also UT = Usertest? Just some examples, from before and after the change?

I'm till very interested in getting this fixed.


# find all list of vrfs
if vrf:
Expand Down Expand Up @@ -341,7 +341,10 @@ def cli(self, vrf=None):
rt = m.groupdict()['rt']
rt_type = m.groupdict()['rt_type']
route_target_dict = af_dict.setdefault('route_target', {}).setdefault(rt, {})
route_target_dict.update({'rt_type': m.groupdict()['rt_type']})
if 'rt_type' in route_target_dict:
route_target_dict.update({'rt_type': 'both'})
else:
route_target_dict.update({'rt_type': rt_type})

if m.groupdict()['rt_evpn_mvpn']:
if 'evpn' in m.groupdict()['rt_evpn_mvpn']:
Expand Down