diff --git a/changelog/undistributed/changelog_show_running-config_vrf_{vrf}_|_sec_'^vrf'_20240426102247.rst b/changelog/undistributed/changelog_show_running-config_vrf_{vrf}_|_sec_'^vrf'_20240426102247.rst new file mode 100644 index 0000000000..cc9f2cf27e --- /dev/null +++ b/changelog/undistributed/changelog_show_running-config_vrf_{vrf}_|_sec_'^vrf'_20240426102247.rst @@ -0,0 +1,7 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- +* NXOS + * Modified ShowRunningConfigVrf: + * Updated regex pattern 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') \ No newline at end of file diff --git a/src/genie/libs/parser/nxos/show_vrf.py b/src/genie/libs/parser/nxos/show_vrf.py index 444df1d7e0..2fe003178b 100755 --- a/src/genie/libs/parser/nxos/show_vrf.py +++ b/src/genie/libs/parser/nxos/show_vrf.py @@ -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\w+) +(?P\w+)( +(?P\w+))?$') + p5 = re.compile(r'^\s*route-target +(?P\w+) +(?P\w+:\w+)( +(?P\w+))?$') # find all list of vrfs if vrf: @@ -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']: