]> git.proxmox.com Git - mirror_frr.git/commitdiff
tools: Fix unbound newaddr variable, fix too-broad except clauses
authorDinesh G Dutt <ddutt@cumulusnetworks.com>
Wed, 11 Jan 2017 19:33:15 +0000 (11:33 -0800)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 30 Jan 2017 18:40:53 +0000 (13:40 -0500)
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>
tools/frr-reload.py

index d26758ab17e31f25b0c05dac6f41896c22d3b441..f6ddd35f665472277f5fe8f7238bbd42c5520891 100755 (executable)
@@ -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