mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 10:38:05 +00:00
topotest: add text normalization function
Standardized function that removes format spaces (or tab) and carriage returns characters. This function is useful to allow output text processing without breaking diff capabilities. Output example: *N IA 2001:db8:2::/64 :: r2-eth0 00:03:39 Becomes: *N IA 2001:db8:2::/64 :: r2-eth0 00:03:39 If you remove 'IA' you won't have space formatting problem anymore.
This commit is contained in:
parent
d176de4d0a
commit
f7840f6bdf
@ -224,6 +224,14 @@ def get_file(content):
|
||||
fde.close()
|
||||
return fname
|
||||
|
||||
def normalize_text(text):
|
||||
"""
|
||||
Strips formating spaces/tabs and carriage returns.
|
||||
"""
|
||||
text = re.sub(r'[ \t]+', ' ', text)
|
||||
text = re.sub(r'\r', '', text)
|
||||
return text
|
||||
|
||||
def checkAddressSanitizerError(output, router, component):
|
||||
"Checks for AddressSanitizer in output. If found, then logs it and returns true, false otherwise"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user