]> git.proxmox.com Git - mirror_frr.git/commitdiff
isis-topo1: simplify dictionary key removal code
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Wed, 20 Dec 2017 12:07:31 +0000 (10:07 -0200)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:13 +0000 (20:22 -0500)
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
tests/topotests/isis-topo1/test_isis_topo1.py

index c855644e3998b62d5ec2554d3131dabaedb8e176..544671da57587de35c4b870f30e690c9d733db6e 100644 (file)
@@ -165,15 +165,8 @@ def test_isis_route_installation():
                         continue
 
                     for nexthop in route['nexthops']:
-                        try:
-                            nexthop.pop('interfaceIndex')
-                        except KeyError:
-                            pass
-
-                        try:
-                            nexthop.pop('interfaceName')
-                        except KeyError:
-                            pass
+                        nexthop.pop('interfaceIndex', None)
+                        nexthop.pop('interfaceName', None)
 
         assertmsg = "Router '{}' routes mismatch".format(rname)
         assert topotest.json_cmp(actual, expected) is None, assertmsg