mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 06:14:35 +00:00
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>
This commit is contained in:
parent
bb972e4465
commit
0845b8727a
@ -206,6 +206,8 @@ class Config(object):
|
|||||||
IPNetwork(addr).prefixlen)
|
IPNetwork(addr).prefixlen)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
newaddr = addr
|
newaddr = addr
|
||||||
|
else:
|
||||||
|
newaddr = addr
|
||||||
|
|
||||||
legestr = re_key_rt.group(5)
|
legestr = re_key_rt.group(5)
|
||||||
re_lege = re.search(r'(.*)le\s+(\d+)\s+ge\s+(\d+)(.*)', legestr)
|
re_lege = re.search(r'(.*)le\s+(\d+)\s+ge\s+(\d+)(.*)', legestr)
|
||||||
@ -247,7 +249,7 @@ class Config(object):
|
|||||||
newaddr.prefixlen,
|
newaddr.prefixlen,
|
||||||
re_net.group(2))
|
re_net.group(2))
|
||||||
newlines.append(line)
|
newlines.append(line)
|
||||||
except:
|
except ValueError:
|
||||||
# Really this should be an error. Whats a network
|
# Really this should be an error. Whats a network
|
||||||
# without an IP Address following it ?
|
# without an IP Address following it ?
|
||||||
newlines.append(line)
|
newlines.append(line)
|
||||||
@ -546,7 +548,7 @@ def get_normalized_ipv6_line(line):
|
|||||||
if not norm_word:
|
if not norm_word:
|
||||||
try:
|
try:
|
||||||
norm_word = '%s' % IPv6Address(word)
|
norm_word = '%s' % IPv6Address(word)
|
||||||
except:
|
except ValueError:
|
||||||
norm_word = word
|
norm_word = word
|
||||||
else:
|
else:
|
||||||
norm_word = word
|
norm_word = word
|
||||||
|
Loading…
Reference in New Issue
Block a user