diff options
| author | Dinesh G Dutt <ddutt@cumulusnetworks.com> | 2017-01-25 11:55:02 -0800 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-01-30 13:40:53 -0500 |
| commit | 4d760f42552b8d8abe5280f049477649a054dcdd (patch) | |
| tree | a0629e9bdba93095e8562f7b5dd02ec8c2a6711b /tools/frr-reload.py | |
| parent | 659b52a8456ea70ee4d7a21c9cb46c58d01ea296 (diff) | |
tools: Silly typo in regex for catching ip route syntax
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>
Diffstat (limited to 'tools/frr-reload.py')
| -rwxr-xr-x | tools/frr-reload.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py index f6ddd35f66..1cad55ac34 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -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 |
