]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: avoid python2 regex syntax 7177/head
authorMark Stapp <mjs@voltanet.io>
Sat, 26 Sep 2020 17:11:39 +0000 (13:11 -0400)
committerMark Stapp <mjs@voltanet.io>
Sat, 26 Sep 2020 19:40:00 +0000 (15:40 -0400)
Update a few regexs to avoid python2-specific syntax

Signed-off-by: Mark Stapp <mjs@voltanet.io>
tests/topotests/lib/common_config.py

index ff187b18c28a8af08ea12640c5d65522aa8caaf8..1fa6d351010e4de6cfda442ba2a0e7318ab53663 100644 (file)
@@ -636,7 +636,7 @@ def get_frr_ipv6_linklocal(tgen, router, intf=None, vrf=None):
                 ll_per_if_count = 0
 
             # Interface ip
-            m1 = re_search("inet6 (fe80[:a-fA-F0-9]+[\/0-9]+)", line)
+            m1 = re_search("inet6 (fe80[:a-fA-F0-9]+[/0-9]+)", line)
             if m1:
                 local = m1.group(1)
                 ll_per_if_count += 1
@@ -698,7 +698,7 @@ def start_topology(tgen, daemon=None):
 
     router_list = tgen.routers()
     ROUTER_LIST = sorted(
-        router_list.keys(), key=lambda x: int(re_search("\d+", x).group(0))
+        router_list.keys(), key=lambda x: int(re_search("[0-9]+", x).group(0))
     )
     TMPDIR = os.path.join(LOGDIR, tgen.modname)
 
@@ -827,7 +827,7 @@ def topo_daemons(tgen, topo):
 
     router_list = tgen.routers()
     ROUTER_LIST = sorted(
-        router_list.keys(), key=lambda x: int(re_search("\d+", x).group(0))
+        router_list.keys(), key=lambda x: int(re_search("[0-9]+", x).group(0))
     )
 
     for rtr in ROUTER_LIST: