Skip to content

Commit

Permalink
network: Remove white space when filtering errors
Browse files Browse the repository at this point in the history
Signed-off-by: Pineda <[email protected]>
  • Loading branch information
jpineda3 committed Dec 12, 2024
1 parent 02f6526 commit 82a787d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions nebula/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,15 @@ def check_dmesg(self, error_on_warnings=False):
res = os.path.join(path, "resources", "err_rejects.txt")
with open(res) as f:
error_rejects = f.readlines()
error_rejects_no_ws = [s.replace(" ", "").replace("\n","") for s in error_rejects]

error_log_filetered = [
i
for i in error_log
if re.sub(r"^\[[\s\.\d]*\] ", "", i) not in error_rejects
]
error_log_filetered = []
for i in error_log:
log = re.sub(r"^\[[\s\.\d]*\] ", "", i)
log_no_ws = log.replace(" ", "").replace("\n","")

if log not in error_rejects and log_no_ws not in error_rejects_no_ws:
error_log_filetered.append(i)

with open("dmesg_err_filtered.log", "w") as outfile:
if error_log_filetered:
Expand Down

0 comments on commit 82a787d

Please sign in to comment.