mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-24 09:13:37 +01:00
ping tests: Silence deprecation warnings
Declare some regex patterns as a raw string by prepending `r`. Reviewed by: markj Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D42174
This commit is contained in:
parent
4859030ef1
commit
8b13cb9d65
@ -270,15 +270,15 @@ def pinger(
|
||||
def redact(output):
|
||||
"""Redact some elements of ping's output"""
|
||||
pattern_replacements = [
|
||||
("localhost \([0-9]{1,3}(\.[0-9]{1,3}){3}\)", "localhost"),
|
||||
("from [0-9]{1,3}(\.[0-9]{1,3}){3}", "from"),
|
||||
(r"localhost \([0-9]{1,3}(\.[0-9]{1,3}){3}\)", "localhost"),
|
||||
(r"from [0-9]{1,3}(\.[0-9]{1,3}){3}", "from"),
|
||||
("hlim=[0-9]*", "hlim="),
|
||||
("ttl=[0-9]*", "ttl="),
|
||||
("time=[0-9.-]*", "time="),
|
||||
("cp: .*", "cp: xx xx xx xx xx xx xx xx"),
|
||||
("dp: .*", "dp: xx xx xx xx xx xx xx xx"),
|
||||
("\(-[0-9\.]+[0-9]+ ms\)", "(- ms)"),
|
||||
("[0-9\.]+/[0-9.]+", "/"),
|
||||
(r"\(-[0-9\.]+[0-9]+ ms\)", "(- ms)"),
|
||||
(r"[0-9\.]+/[0-9.]+", "/"),
|
||||
]
|
||||
for pattern, repl in pattern_replacements:
|
||||
output = re.sub(pattern, repl, output)
|
||||
|
Loading…
Reference in New Issue
Block a user