Skip to content

Commit

Permalink
Addressing the mypy build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
umfranci committed Jan 27, 2025
1 parent fcf0295 commit 3c8932c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lisa/notifiers/dmesg_oops.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import re
from dataclasses import dataclass
from pathlib import Path
from typing import Any, List, Pattern, Type, cast
from typing import Any, Dict, List, Pattern, Type, cast

from dataclasses_json import dataclass_json

Expand Down Expand Up @@ -44,7 +44,7 @@ class DmsgOops(notifier.Notifier):
"""
A sample notifier to check for Panics/OOPs Errors in the DMesg Logs.
"""

dmesg_errors: Dict[str, Dict[str, List[str]]]
@classmethod
def type_name(cls) -> str:
return "dmsg_oops_notifier"
Expand All @@ -59,9 +59,9 @@ def save_results(self) -> None:
file_path = constants.RUN_LOCAL_LOG_PATH / file_path
self._log.info(f"Writing output to file {file_path}")
with open(file_path, "w") as f:
f.write(str(self.dmesg_errors)) # type: ignore
f.write(str(self.dmesg_errors))

def check_kernel_oops(self, dmesg_logs: str, context_lines: int = 4) -> list[str]:
def check_kernel_oops(self, dmesg_logs: str, context_lines: int = 4) -> List[str]:
oops_list = []
lines = dmesg_logs.splitlines()
for i, line in enumerate(lines):
Expand All @@ -80,7 +80,7 @@ def dmesg_error_check(self, test_name: str, dmesg_logs: str) -> None:
self._log.info("DMesg logs check completed")

def process_serial_logs(
self, test_name: str, file_path: str, pattern_start: str, pattern_end: str
self, test_name: str, file_path: Path, pattern_start: str, pattern_end: str
) -> None:
with open(file_path, "r") as file:
buffer = file.read()
Expand Down

0 comments on commit 3c8932c

Please sign in to comment.