]> git.puffer.fish Git - mirror/frr.git/commitdiff
tools: Silly typo in regex for catching ip route syntax
authorDinesh G Dutt <ddutt@cumulusnetworks.com>
Wed, 25 Jan 2017 19:55:02 +0000 (11:55 -0800)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 30 Jan 2017 18:40:53 +0000 (13:40 -0500)
Ticket: CM-14600
Reviewed By: CCR-5615
Testing Done: Verifying the issue with/without the fix

I had intended the regexp to catch both ip and ipv6 routes, but somewhere
along the way, I left out the grouping in the regexp to catch if it was
ip or ipv6 at the start. This caused all the rest of the matches and replaces
to be off causing the issue reported by the bug.

Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
tools/frr-reload.py

index f6ddd35f665472277f5fe8f7238bbd42c5520891..1cad55ac34952209efd164aa91c678741d44012b 100755 (executable)
@@ -181,16 +181,16 @@ class Config(object):
             11.1.1.0/24. Ensure we don't do a needless operation for such
             lines. IS-IS & OSPFv3 have no "network" support.
         '''
-        re_key_rt = re.match(r'ip\s+route\s+([A-Fa-f:.0-9/]+)(.*)$', key[0])
+        re_key_rt = re.match(r'(ip|ipv6)\s+route\s+([A-Fa-f:.0-9/]+)(.*)$', key[0])
         if re_key_rt:
             addr = re_key_rt.group(2)
             if '/' in addr:
                 try:
                     newaddr = IPNetwork(addr)
-                    key[0] = 'ip %s %s/%s%s' % (re_key_rt.group(1),
-                                                newaddr.network,
-                                                newaddr.prefixlen,
-                                                re_key_rt.group(3))
+                    key[0] = '%s route %s/%s%s' % (re_key_rt.group(1),
+                                                   newaddr.network,
+                                                   newaddr.prefixlen,
+                                                   re_key_rt.group(3))
                 except ValueError:
                     pass