]> git.puffer.fish Git - mirror/frr.git/commitdiff
topotests: python3, rename iterkey() with key() for dictionary usage
authorPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 25 Nov 2020 12:49:45 +0000 (12:49 +0000)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 25 Nov 2020 16:31:45 +0000 (16:31 +0000)
dictionary method iterkey() is not used in python3 and is replaced with
key() method.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
tests/topotests/all-protocol-startup/test_all_protocol_startup.py
tests/topotests/bgp_multiview_topo1/test_bgp_multiview_topo1.py
tests/topotests/lib/bgprib.py

index 0254ff6af6a404aeb5db17b5cc39702455669c53..96b88914a743acb61c18451e5f8b3eb8122945d1 100644 (file)
@@ -1065,7 +1065,7 @@ def test_bgp_ipv4():
 
         if not success:
             resultstr = "No template matched.\n"
-            for f in diffresult.iterkeys():
+            for f in diffresult.keys():
                 resultstr += "template %s: r%s failed SHOW BGP IPv4 check:\n%s\n" % (
                     f,
                     i,
@@ -1134,7 +1134,7 @@ def test_bgp_ipv6():
 
         if not success:
             resultstr = "No template matched.\n"
-            for f in diffresult.iterkeys():
+            for f in diffresult.keys():
                 resultstr += "template %s: r%s failed SHOW BGP IPv6 check:\n%s\n" % (
                     f,
                     i,
index 6344f7bb406453297865e3d7ff91bab007228fd7..7635f741251fdf4ea8c71a5cb54bd52716173d50 100644 (file)
@@ -332,7 +332,7 @@ def test_bgp_routingTable():
 
             if not success:
                 resultstr = "No template matched.\n"
-                for f in diffresult.iterkeys():
+                for f in diffresult.keys():
                     resultstr += (
                         "template %s: r%s failed Routing Table Check for view %s:\n%s\n"
                         % (f, i, view, diffresult[f])
index a23092de832b58c34aec6758bbbb2fc53f97a554..abab9600a1d8e0c970cd153e03255b95572a1288 100644 (file)
@@ -45,7 +45,7 @@ class BgpRib:
 
     def routes_include_wanted(self, pfxtbl, want, debug):
         # helper function to RequireVpnRoutes
-        for pfx in pfxtbl.iterkeys():
+        for pfx in pfxtbl.keys():
             if debug:
                 self.log("trying pfx %s" % pfx)
             if pfx != want["p"]:
@@ -107,7 +107,7 @@ class BgpRib:
             found = 0
             if debug:
                 self.log("want rd %s" % want["rd"])
-            for rd in rds.iterkeys():
+            for rd in rds.keys():
                 if rd != want["rd"]:
                     continue
                 if debug: