From 1e5b2db6447dfffe8aa3e98a1362a7cb9e692e41 Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Sat, 26 Sep 2020 13:11:39 -0400 Subject: [PATCH] tests: avoid python2 regex syntax Update a few regexs to avoid python2-specific syntax Signed-off-by: Mark Stapp --- tests/topotests/lib/common_config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py index ff187b18c2..1fa6d35101 100644 --- a/tests/topotests/lib/common_config.py +++ b/tests/topotests/lib/common_config.py @@ -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: