diff --git a/changelog/undistributed/change_log_show_vrf_iosxe_20231209154701.rst b/changelog/undistributed/change_log_show_vrf_iosxe_20231209154701.rst new file mode 100644 index 0000000000..6b9b7c2e7d --- /dev/null +++ b/changelog/undistributed/change_log_show_vrf_iosxe_20231209154701.rst @@ -0,0 +1,6 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- +* IOSXE + * Modified ShowVrf: + * Standardized VRF Matching to include special characters beyond dash and dot \ No newline at end of file diff --git a/src/genie/libs/parser/iosxe/show_vrf.py b/src/genie/libs/parser/iosxe/show_vrf.py index 3c282e6dc2..bd48381a42 100755 --- a/src/genie/libs/parser/iosxe/show_vrf.py +++ b/src/genie/libs/parser/iosxe/show_vrf.py @@ -65,7 +65,7 @@ def cli(self, vrf='', output=None): # test 10.116.83.34:100 ipv4,ipv6 Lo100 # ce1 ipv4,ipv6 Et1/0 # * ce1 2:2 ipv4,ipv6 - p1 = re.compile(r'^(((?P\*))\s+)?(?P[\w\d\-\.]+)\s+(?P\||[\.\d\:]+)(?:\s+(?P[(?:ipv\d)\,]+))?(?:\s+(?P[\S\s]+))?$') + p1 = re.compile(r'^(((?P\*))\s+)?(?P[\S]+)\s+(?P\||[\.\d\:]+)(?:\s+(?P[(?:ipv\d)\,]+))?(?:\s+(?P[\S\s]+))?$') # Lo300 # Gi2.390 @@ -282,7 +282,7 @@ def cli(self, output=None): r'current +count +(?P\d+)$') # VRF label distribution protocol: not configured - p10 = re.compile(r'^VRF +label +distribution +protocol: +(?P[\w\s\-]+)$') + p10 = re.compile(r'^VRF +label +distribution +protocol: +(?P[\S]+)$') # VRF label allocation mode: per-prefix p11 = re.compile(r'^VRF +label +allocation +mode: +(?P[\w\s\-]+)' @@ -591,7 +591,7 @@ def cli(self, vrf='',output=None): output = self.device.execute(self.cli_command.format(vrf=vrf)) res_dict = {} - p1 = re.compile(r'^(?P[\w\d]+)+\s+(?P[\d\:\d]+)+\s+(?P[\w\,\w]+)\s+\s\s(?P[\w\d]+)*$') + p1 = re.compile(r'^(?P[\S]+)+\s+(?P[\d\:\d]+)+\s+(?P[\w\,\w]+)\s+\s\s(?P[\w\d]+)*$') for line in output.splitlines(): line = line.strip() # vrf21 21:1 ipv4,ipv6 Vl21''' @@ -648,7 +648,7 @@ def cli(self, protocol, ip, option, mask, output=None): output = self.device.execute(self.cli_command.format(protocol=protocol, option=option, ip=ip,mask=mask)) # VRF Default - p1 = re.compile(r'^VRF\s+(?P[\w\s\-]+)$') + p1 = re.compile(r'^VRF\s+(?P[\S]+)$') # ------------------ show ip route vrf Default 11.1.6.1 255.255.255.0 ------------------ # ------------------ show ip cef vrf vrf1000 11.1.6.1 255.255.255.0 internal ------------------ diff --git a/src/genie/libs/parser/iosxe/tests/ShowVrf/cli/equal/golden_output_4_expected.py b/src/genie/libs/parser/iosxe/tests/ShowVrf/cli/equal/golden_output_4_expected.py new file mode 100644 index 0000000000..26f1e00a7f --- /dev/null +++ b/src/genie/libs/parser/iosxe/tests/ShowVrf/cli/equal/golden_output_4_expected.py @@ -0,0 +1,8 @@ +expected_output = { + "vrf": { + "t!#$%()*+@^:t/<>,.~`'\";t": { + "protocols": ["ipv4", "ipv6"], + "route_distinguisher": "1:1" + }, + } +} \ No newline at end of file diff --git a/src/genie/libs/parser/iosxe/tests/ShowVrf/cli/equal/golden_output_4_output.txt b/src/genie/libs/parser/iosxe/tests/ShowVrf/cli/equal/golden_output_4_output.txt new file mode 100644 index 0000000000..fdb0c031d7 --- /dev/null +++ b/src/genie/libs/parser/iosxe/tests/ShowVrf/cli/equal/golden_output_4_output.txt @@ -0,0 +1,2 @@ + Name Default RD Protocols Interfaces + t!#$%()*+@^:t/<>,.~`'";t 1:1 ipv4,ipv6 \ No newline at end of file