summaryrefslogtreecommitdiffstats
path: root/tools/frr-reload.py
diff options
context:
space:
mode:
authorDinesh G Dutt <ddutt@cumulusnetworks.com>2017-01-11 20:33:15 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-01-30 19:40:53 +0100
commit0845b8727a90768a1a8e6ff389bfe83c2e87d2e9 (patch)
tree2ee5564d419310a4cf7942c504979e30f9e38599 /tools/frr-reload.py
parenttools: Normalize prefix-lists and IP networks for avoiding unnecessary reload (diff)
downloadfrr-0845b8727a90768a1a8e6ff389bfe83c2e87d2e9.tar.xz
frr-0845b8727a90768a1a8e6ff389bfe83c2e87d2e9.zip
tools: Fix unbound newaddr variable, fix too-broad except clauses
Ticket: CM-14351 Reviewed By: dwalton Testing Done:attempts to run NCLU test failed, Daniel verified. Uninit variable bug, plus missed adding ValueError to the except clauses in a couple of places. Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
Diffstat (limited to 'tools/frr-reload.py')
-rwxr-xr-xtools/frr-reload.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py
index d26758ab1..f6ddd35f6 100755
--- a/tools/frr-reload.py
+++ b/tools/frr-reload.py
@@ -206,6 +206,8 @@ class Config(object):
IPNetwork(addr).prefixlen)
except ValueError:
newaddr = addr
+ else:
+ newaddr = addr
legestr = re_key_rt.group(5)
re_lege = re.search(r'(.*)le\s+(\d+)\s+ge\s+(\d+)(.*)', legestr)
@@ -247,7 +249,7 @@ class Config(object):
newaddr.prefixlen,
re_net.group(2))
newlines.append(line)
- except:
+ except ValueError:
# Really this should be an error. Whats a network
# without an IP Address following it ?
newlines.append(line)
@@ -546,7 +548,7 @@ def get_normalized_ipv6_line(line):
if not norm_word:
try:
norm_word = '%s' % IPv6Address(word)
- except:
+ except ValueError:
norm_word = word
else:
norm_word = word