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.
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"