Skip to content

Commit

Permalink
Merge pull request #128 from sdgtt/err_rejects_ws
Browse files Browse the repository at this point in the history
network: Remove white space when filtering errors
  • Loading branch information
kimpaller authored Jan 9, 2025
2 parents e2deb20 + eb7e737 commit 46ac525
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions nebula/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,18 @@ 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_log_filetered = [
i
for i in error_log
if re.sub(r"^\[[\s\.\d]*\] ", "", i) not in error_rejects
error_rejects_no_ws = [
s.replace(" ", "").replace("\n", "") for s 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_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:
for line in error_log_filetered:
Expand Down

0 comments on commit 46ac525

Please sign in to comment.