diff options
| author | Giovanni Tataranni <g.tataranni@gmail.com> | 2024-09-02 19:10:26 +0200 |
|---|---|---|
| committer | Giovanni Tataranni <g.tataranni@gmail.com> | 2024-09-03 19:14:45 +0200 |
| commit | fe9e148aaa2990125e896730e97af4b3b7a9f536 (patch) | |
| tree | 4694c2a3470344f46d05846a997086c427330efb /tools | |
| parent | f85dfb3f1a66c4e6085162451583e764e2c41a25 (diff) | |
tools: fix invalid escape on regex string
fix usage of regex string without proper escaping
Signed-off-by: Giovanni Tataranni <g.tataranni@gmail.com>
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/frr-reload.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py index a88f6b616d..9dae348b8e 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -203,7 +203,7 @@ def get_normalized_es_id(line): """ sub_strs = ["evpn mh es-id", "evpn mh es-sys-mac"] for sub_str in sub_strs: - obj = re.match(sub_str + " (?P<esi>\S*)", line) + obj = re.match(sub_str + r" (?P<esi>\S*)", line) if obj: line = "%s %s" % (sub_str, obj.group("esi").lower()) break @@ -871,7 +871,7 @@ def bgp_delete_nbr_remote_as_line(lines_to_add): if ctx_keys[0] not in pg_dict: pg_dict[ctx_keys[0]] = dict() # find 'neighbor <pg_name> peer-group' - re_pg = re.match("neighbor (\S+) peer-group$", line) + re_pg = re.match(r"neighbor (\S+) peer-group$", line) if re_pg and re_pg.group(1) not in pg_dict[ctx_keys[0]]: pg_dict[ctx_keys[0]][re_pg.group(1)] = { "nbr": list(), @@ -1066,7 +1066,7 @@ def bgp_delete_move_lines(lines_to_add, lines_to_del): if ctx_keys[0] not in del_dict: del_dict[ctx_keys[0]] = dict() # find 'no neighbor <pg_name> peer-group' - re_pg = re.match("neighbor (\S+) peer-group$", line) + re_pg = re.match(r"neighbor (\S+) peer-group$", line) if re_pg and re_pg.group(1) not in del_dict[ctx_keys[0]]: del_dict[ctx_keys[0]][re_pg.group(1)] = list() found_pg_del_cmd = True |
