From 22129d43503b48899322361e2cfc856aeea4e0c7 Mon Sep 17 00:00:00 2001 From: Alexandra Bara Date: Thu, 29 Jan 2026 14:08:10 -0600 Subject: [PATCH 1/5] dup fix --- nodescraper/models/taskresult.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nodescraper/models/taskresult.py b/nodescraper/models/taskresult.py index dd5990ef..dd800675 100644 --- a/nodescraper/models/taskresult.py +++ b/nodescraper/models/taskresult.py @@ -127,14 +127,20 @@ def _get_event_summary(self) -> str: f"{msg} (x{count})" if count > 1 else msg for msg, count in warning_msg_counts.items() ] - summary_parts.append(f"{total_warnings} warnings: {', '.join(warning_details)}") + if total_warnings == 1: + summary_parts.append(warning_details[0]) + else: + summary_parts.append(f"{total_warnings} warnings: {', '.join(warning_details)}") if error_msg_counts: total_errors = sum(error_msg_counts.values()) error_details = [ f"{msg} (x{count})" if count > 1 else msg for msg, count in error_msg_counts.items() ] - summary_parts.append(f"{total_errors} errors: {', '.join(error_details)}") + if total_errors == 1: + summary_parts.append(error_details[0]) + else: + summary_parts.append(f"{total_errors} errors: {', '.join(error_details)}") return "; ".join(summary_parts) From b4c559b964077a5224e7ec4e4ed87be28ca3895d Mon Sep 17 00:00:00 2001 From: Alexandra Bara Date: Thu, 29 Jan 2026 14:15:24 -0600 Subject: [PATCH 2/5] test with other plugins --- nodescraper/models/taskresult.py | 10 ++-------- .../plugins/inband/bios/bios_analyzer.py | 6 ++---- .../plugins/inband/cmdline/cmdline_analyzer.py | 4 ++-- .../device_enumeration_analyzer.py | 5 ++--- .../plugins/inband/dkms/dkms_analyzer.py | 4 +--- .../plugins/inband/kernel/kernel_analyzer.py | 6 ++---- .../kernel_module/kernel_module_analyzer.py | 18 ++++++++---------- .../plugins/inband/memory/memory_analyzer.py | 8 ++------ nodescraper/plugins/inband/os/os_analyzer.py | 4 ++-- .../plugins/inband/package/package_analyzer.py | 4 ++-- .../plugins/inband/process/process_analyzer.py | 16 +++++++--------- .../plugins/inband/rocm/rocm_analyzer.py | 10 ++++------ 12 files changed, 36 insertions(+), 59 deletions(-) diff --git a/nodescraper/models/taskresult.py b/nodescraper/models/taskresult.py index dd800675..dd5990ef 100644 --- a/nodescraper/models/taskresult.py +++ b/nodescraper/models/taskresult.py @@ -127,20 +127,14 @@ def _get_event_summary(self) -> str: f"{msg} (x{count})" if count > 1 else msg for msg, count in warning_msg_counts.items() ] - if total_warnings == 1: - summary_parts.append(warning_details[0]) - else: - summary_parts.append(f"{total_warnings} warnings: {', '.join(warning_details)}") + summary_parts.append(f"{total_warnings} warnings: {', '.join(warning_details)}") if error_msg_counts: total_errors = sum(error_msg_counts.values()) error_details = [ f"{msg} (x{count})" if count > 1 else msg for msg, count in error_msg_counts.items() ] - if total_errors == 1: - summary_parts.append(error_details[0]) - else: - summary_parts.append(f"{total_errors} errors: {', '.join(error_details)}") + summary_parts.append(f"{total_errors} errors: {', '.join(error_details)}") return "; ".join(summary_parts) diff --git a/nodescraper/plugins/inband/bios/bios_analyzer.py b/nodescraper/plugins/inband/bios/bios_analyzer.py index a78f3158..961d9e36 100644 --- a/nodescraper/plugins/inband/bios/bios_analyzer.py +++ b/nodescraper/plugins/inband/bios/bios_analyzer.py @@ -80,13 +80,11 @@ def analyze_data( self.result.status = ExecutionStatus.OK return self.result - self.result.message = ( - f"Bios data mismatch! Expected {args.exp_bios_version}, actual: {data.bios_version}" - ) + self.result.message = "Bios data mismatch!" self.result.status = ExecutionStatus.ERROR self._log_event( category=EventCategory.BIOS, - description=f"{self.result.message}, Actual: {data.bios_version}", + description=f"Bios data mismatch! Expected {args.exp_bios_version}, actual: {data.bios_version}", data={ "actual_bios_version": data.bios_version, "expected_bios_version": args.exp_bios_version, diff --git a/nodescraper/plugins/inband/cmdline/cmdline_analyzer.py b/nodescraper/plugins/inband/cmdline/cmdline_analyzer.py index f36fa950..f377777a 100644 --- a/nodescraper/plugins/inband/cmdline/cmdline_analyzer.py +++ b/nodescraper/plugins/inband/cmdline/cmdline_analyzer.py @@ -167,11 +167,11 @@ def analyze_data( self.result.status = ExecutionStatus.OK return self.result - self.result.message = f"Illegal kernel cmdline, found_banned: {found_banned}, missing required: {missing_required}" + self.result.message = "Illegal kernel cmdline" self.result.status = ExecutionStatus.ERROR self._log_event( category=EventCategory.OS, - description=self.result.message, + description=f"Illegal kernel cmdline, found_banned: {found_banned}, missing required: {missing_required}", priority=EventPriority.CRITICAL, console_log=True, ) diff --git a/nodescraper/plugins/inband/device_enumeration/device_enumeration_analyzer.py b/nodescraper/plugins/inband/device_enumeration/device_enumeration_analyzer.py index 7cf39335..cdc58c0f 100644 --- a/nodescraper/plugins/inband/device_enumeration/device_enumeration_analyzer.py +++ b/nodescraper/plugins/inband/device_enumeration/device_enumeration_analyzer.py @@ -64,12 +64,11 @@ def analyze_data( for check, accepted_counts in checks.items(): actual_count = getattr(data, check) if actual_count not in accepted_counts: - message = f"Expected {check} in {accepted_counts}, but got {actual_count}. " - self.result.message += message + self.result.message = "Device Enumeration mismatch" self.result.status = ExecutionStatus.ERROR self._log_event( category=EventCategory.PLATFORM, - description=message, + description=f"Expected {check} in {accepted_counts}, but got {actual_count}", data={check: actual_count}, priority=EventPriority.CRITICAL, console_log=True, diff --git a/nodescraper/plugins/inband/dkms/dkms_analyzer.py b/nodescraper/plugins/inband/dkms/dkms_analyzer.py index fae7b87d..db0686df 100644 --- a/nodescraper/plugins/inband/dkms/dkms_analyzer.py +++ b/nodescraper/plugins/inband/dkms/dkms_analyzer.py @@ -99,8 +99,6 @@ def analyze_data( if error_state: self.result.status = ExecutionStatus.ERROR - self.result.message = ( - f"DKMS data mismatch. \nActual: {actual_values}.\nExpected: {expected_values}" - ) + self.result.message = "DKMS data mismatch" return self.result diff --git a/nodescraper/plugins/inband/kernel/kernel_analyzer.py b/nodescraper/plugins/inband/kernel/kernel_analyzer.py index 1ff4e45a..4657b842 100644 --- a/nodescraper/plugins/inband/kernel/kernel_analyzer.py +++ b/nodescraper/plugins/inband/kernel/kernel_analyzer.py @@ -77,13 +77,11 @@ def analyze_data( self.result.status = ExecutionStatus.OK return self.result - self.result.message = ( - f"Kernel mismatch! Expected: {args.exp_kernel}, actual: {data.kernel_version}" - ) + self.result.message = "Kernel mismatch!" self.result.status = ExecutionStatus.ERROR self._log_event( category=EventCategory.OS, - description=f"{self.result.message}", + description=f"Kernel mismatch! Expected: {args.exp_kernel}, actual: {data.kernel_version}", data={"expected": args.exp_kernel, "actual": data.kernel_version}, priority=EventPriority.CRITICAL, console_log=True, diff --git a/nodescraper/plugins/inband/kernel_module/kernel_module_analyzer.py b/nodescraper/plugins/inband/kernel_module/kernel_module_analyzer.py index bcf58a33..e6131fda 100644 --- a/nodescraper/plugins/inband/kernel_module/kernel_module_analyzer.py +++ b/nodescraper/plugins/inband/kernel_module/kernel_module_analyzer.py @@ -146,24 +146,22 @@ def analyze_data( except re.error: self._log_event( category=EventCategory.RUNTIME, - description="KernelModule regex is invalid", + description=f"KernelModule regex is invalid. Regex: {args.regex_filter}", data={"regex_filters": {args.regex_filter}}, priority=EventPriority.ERROR, ) - self.result.message = ( - f"Kernel modules failed to match regex. Regex: {args.regex_filter}" - ) + self.result.message = "Kernel modules failed to match regex" self.result.status = ExecutionStatus.ERROR return self.result if unmatched_pattern: self._log_event( category=EventCategory.RUNTIME, - description="KernelModules did not match all patterns", + description=f"KernelModules did not match all patterns. Unmatched patterns: {unmatched_pattern}", data={"unmatched_pattern: ": unmatched_pattern}, priority=EventPriority.INFO, ) - self.result.message = f"Kernel modules failed to match every pattern. Unmatched patterns: {unmatched_pattern}" + self.result.message = "Kernel modules failed to match every pattern" self.result.status = ExecutionStatus.ERROR return self.result @@ -184,11 +182,11 @@ def analyze_data( if not filtered_modules and not_matched: self._log_event( category=EventCategory.RUNTIME, - description="KernelModules: no modules matched", + description=f"KernelModules: no modules matched. Not matched: {not_matched}", data=args.kernel_modules, priority=EventPriority.ERROR, ) - self.result.message = f"Kernel modules not matched: {not_matched}" + self.result.message = "Kernel modules not matched" self.result.status = ExecutionStatus.ERROR return self.result # some modules matched @@ -196,11 +194,11 @@ def analyze_data( self._log_event( category=EventCategory.RUNTIME, - description="KernelModules: not all modules matched", + description=f"KernelModules: not all modules matched. Not matched: {not_matched}", data=not_matched, priority=EventPriority.ERROR, ) - self.result.message = f"Kernel modules not matched: {not_matched}" + self.result.message = "Kernel modules not matched" self.result.status = ExecutionStatus.ERROR return self.result else: diff --git a/nodescraper/plugins/inband/memory/memory_analyzer.py b/nodescraper/plugins/inband/memory/memory_analyzer.py index 49a8ab6b..f9c941e4 100644 --- a/nodescraper/plugins/inband/memory/memory_analyzer.py +++ b/nodescraper/plugins/inband/memory/memory_analyzer.py @@ -83,15 +83,11 @@ def _bytes_to_gb(n: float) -> float: ) self.result.status = ExecutionStatus.OK else: - self.result.message = ( - f"Memory usage exceeded max allowed! Used {used_gb:.2f} GB, " - f"max allowed {allowed_gb:.2f} GB " - f"(base={base_source} {base_gb:.2f} GB × ratio={args.ratio:.2f})" - ) + self.result.message = "Memory usage exceeded max allowed!" self.result.status = ExecutionStatus.ERROR self._log_event( category=EventCategory.OS, - description=self.result.message, + description=f"Memory usage exceeded max allowed! Used {used_gb:.2f} GB, max allowed {allowed_gb:.2f} GB (base={base_source} {base_gb:.2f} GB × ratio={args.ratio:.2f})", priority=EventPriority.CRITICAL, data={ "used_memory": used_memory, diff --git a/nodescraper/plugins/inband/os/os_analyzer.py b/nodescraper/plugins/inband/os/os_analyzer.py index 0d952468..235b4aab 100644 --- a/nodescraper/plugins/inband/os/os_analyzer.py +++ b/nodescraper/plugins/inband/os/os_analyzer.py @@ -61,11 +61,11 @@ def analyze_data(self, data: OsDataModel, args: Optional[OsAnalyzerArgs] = None) self.result.status = ExecutionStatus.OK return self.result - self.result.message = f"OS name mismatch! Expected: {args.exp_os}, actual: {data.os_name}" + self.result.message = "OS name mismatch!" self.result.status = ExecutionStatus.ERROR self._log_event( category=EventCategory.OS, - description=f"{self.result.message}", + description=f"OS name mismatch! Expected: {args.exp_os}, actual: {data.os_name}", data={"expected": args.exp_os, "actual": data.os_name}, priority=EventPriority.CRITICAL, console_log=True, diff --git a/nodescraper/plugins/inband/package/package_analyzer.py b/nodescraper/plugins/inband/package/package_analyzer.py index 906b7a08..66b67b5a 100644 --- a/nodescraper/plugins/inband/package/package_analyzer.py +++ b/nodescraper/plugins/inband/package/package_analyzer.py @@ -236,7 +236,7 @@ def analyze_data( total_errors = len(not_found_keys) + len(regex_errors) + len(version_mismatches) if total_errors > 0: - self.result.message = f"{'; '.join(error_parts)}" + self.result.message = "Package version mismatch" self.result.status = ExecutionStatus.ERROR else: self.result.message = "All packages found and versions matched" @@ -247,7 +247,7 @@ def analyze_data( data.version_info, args.exp_package_ver ) if not_found_match or not_found_version: - self.result.message = f"Package version missmatched. Missmatched versions: {not_found_match}, not found versions: {not_found_version}" + self.result.message = "Package version mismatch" self.result.status = ExecutionStatus.ERROR return self.result diff --git a/nodescraper/plugins/inband/process/process_analyzer.py b/nodescraper/plugins/inband/process/process_analyzer.py index 58e584d0..8700f1c1 100644 --- a/nodescraper/plugins/inband/process/process_analyzer.py +++ b/nodescraper/plugins/inband/process/process_analyzer.py @@ -55,14 +55,12 @@ def analyze_data( if not args: args = ProcessAnalyzerArgs() - err_messages = [] + has_errors = False if data.kfd_process is not None and data.kfd_process > args.max_kfd_processes: - err_messages.append( - f"Kfd processes {data.kfd_process} exeed max limit {args.max_kfd_processes}" - ) + has_errors = True self._log_event( category=EventCategory.OS, - description="Kfd processes exceed maximum limit", + description=f"Kfd processes {data.kfd_process} exeed max limit {args.max_kfd_processes}", data={ "kfd_process": data.kfd_process, "kfd_process_limit": args.max_kfd_processes, @@ -72,10 +70,10 @@ def analyze_data( ) if data.cpu_usage is not None and data.cpu_usage > args.max_cpu_usage: - err_messages.append(f"CPU usage {data.cpu_usage} exceeds limit {args.max_cpu_usage}") + has_errors = True self._log_event( category=EventCategory.OS, - description="CPU usage exceeds maximum limit", + description=f"CPU usage {data.cpu_usage} exceeds limit {args.max_cpu_usage}", data={ "cpu_usage": data.cpu_usage, "cpu_usage_limit": args.max_cpu_usage, @@ -84,8 +82,8 @@ def analyze_data( console_log=True, ) - if err_messages: + if has_errors: self.result.status = ExecutionStatus.ERROR - self.result.message = ". ".join(err_messages) + self.result.message = "Process limits exceeded" return self.result diff --git a/nodescraper/plugins/inband/rocm/rocm_analyzer.py b/nodescraper/plugins/inband/rocm/rocm_analyzer.py index 1131d665..ea17969f 100644 --- a/nodescraper/plugins/inband/rocm/rocm_analyzer.py +++ b/nodescraper/plugins/inband/rocm/rocm_analyzer.py @@ -64,13 +64,11 @@ def analyze_data( break else: # No matching version found - self.result.message = ( - f"ROCm version mismatch! Expected: {args.exp_rocm}, actual: {data.rocm_version}" - ) + self.result.message = "ROCm version mismatch!" self.result.status = ExecutionStatus.ERROR self._log_event( category=EventCategory.SW_DRIVER, - description=f"{self.result.message}", + description=f"ROCm version mismatch! Expected: {args.exp_rocm}, actual: {data.rocm_version}", data={"expected": args.exp_rocm, "actual": data.rocm_version}, priority=EventPriority.CRITICAL, console_log=True, @@ -80,11 +78,11 @@ def analyze_data( # validate rocm_latest if provided in args if args.exp_rocm_latest: if data.rocm_latest_versioned_path != args.exp_rocm_latest: - self.result.message = f"ROCm latest path mismatch! Expected: {args.exp_rocm_latest}, actual: {data.rocm_latest_versioned_path}" + self.result.message = "ROCm latest path mismatch!" self.result.status = ExecutionStatus.ERROR self._log_event( category=EventCategory.SW_DRIVER, - description=f"{self.result.message}", + description=f"ROCm latest path mismatch! Expected: {args.exp_rocm_latest}, actual: {data.rocm_latest_versioned_path}", data={ "expected": args.exp_rocm_latest, "actual": data.rocm_latest_versioned_path, From 4c9a55b2285108736073f9a35e8e4f67a48c11f1 Mon Sep 17 00:00:00 2001 From: Alexandra Bara Date: Thu, 29 Jan 2026 15:16:34 -0600 Subject: [PATCH 3/5] test fix --- test/unit/plugin/test_kernel_module_analyzer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/unit/plugin/test_kernel_module_analyzer.py b/test/unit/plugin/test_kernel_module_analyzer.py index 032b7833..376f317a 100644 --- a/test/unit/plugin/test_kernel_module_analyzer.py +++ b/test/unit/plugin/test_kernel_module_analyzer.py @@ -126,7 +126,10 @@ def test_analyze_data_regex_unmatched_patterns(data_model, analyzer): args = KernelModuleAnalyzerArgs(regex_filter=["modA", "nope"]) result = analyzer.analyze_data(data_model, args) assert result.status == ExecutionStatus.ERROR - assert any(ev.description == "KernelModules did not match all patterns" for ev in result.events) + assert any( + ev.description.startswith("KernelModules did not match all patterns") + for ev in result.events + ) def test_analyze_data_name_only_success(data_model, analyzer): From 38ee62215e7a5aa0324c2150be748604a17c8884 Mon Sep 17 00:00:00 2001 From: Alexandra Bara Date: Thu, 29 Jan 2026 15:42:12 -0600 Subject: [PATCH 4/5] undid kmodplugin changes + extra width for status col --- .../plugins/inband/kernel_module/kernel_module_analyzer.py | 6 +++--- nodescraper/resultcollators/tablesummary.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nodescraper/plugins/inband/kernel_module/kernel_module_analyzer.py b/nodescraper/plugins/inband/kernel_module/kernel_module_analyzer.py index e6131fda..f4876de2 100644 --- a/nodescraper/plugins/inband/kernel_module/kernel_module_analyzer.py +++ b/nodescraper/plugins/inband/kernel_module/kernel_module_analyzer.py @@ -161,7 +161,7 @@ def analyze_data( data={"unmatched_pattern: ": unmatched_pattern}, priority=EventPriority.INFO, ) - self.result.message = "Kernel modules failed to match every pattern" + self.result.message = f"Kernel modules failed to match every pattern. Unmatched patterns: {unmatched_pattern}" self.result.status = ExecutionStatus.ERROR return self.result @@ -186,7 +186,7 @@ def analyze_data( data=args.kernel_modules, priority=EventPriority.ERROR, ) - self.result.message = "Kernel modules not matched" + self.result.message = f"Kernel modules not matched. Not matched: {not_matched}" self.result.status = ExecutionStatus.ERROR return self.result # some modules matched @@ -198,7 +198,7 @@ def analyze_data( data=not_matched, priority=EventPriority.ERROR, ) - self.result.message = "Kernel modules not matched" + self.result.message = f"Kernel modules not matched. Not matched: {not_matched}" self.result.status = ExecutionStatus.ERROR return self.result else: diff --git a/nodescraper/resultcollators/tablesummary.py b/nodescraper/resultcollators/tablesummary.py index 44b723fb..49f816b2 100644 --- a/nodescraper/resultcollators/tablesummary.py +++ b/nodescraper/resultcollators/tablesummary.py @@ -134,7 +134,7 @@ def render_physical_row(parts: list[str]) -> str: table = gen_str_table( ["Connection", "Status", "Message"], conn_rows, - max_widths={"Connection": 32, "Status": 16, "Message": 80}, + max_widths={"Connection": 32, "Status": 20, "Message": 80}, ) tables += f"\n\n{table}" @@ -151,7 +151,7 @@ def render_physical_row(parts: list[str]) -> str: table = gen_str_table( ["Plugin", "Status", "Message"], plug_rows, - max_widths={"Plugin": 32, "Status": 16, "Message": 80}, + max_widths={"Plugin": 32, "Status": 20, "Message": 80}, ) tables += f"\n\n{table}" From d2c9f7f0a4ca158c0a1a14f6a594ebca0a600202 Mon Sep 17 00:00:00 2001 From: Alexandra Bara Date: Thu, 29 Jan 2026 16:17:27 -0600 Subject: [PATCH 5/5] rolled back dkms changes --- nodescraper/plugins/inband/dkms/dkms_analyzer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nodescraper/plugins/inband/dkms/dkms_analyzer.py b/nodescraper/plugins/inband/dkms/dkms_analyzer.py index db0686df..fae7b87d 100644 --- a/nodescraper/plugins/inband/dkms/dkms_analyzer.py +++ b/nodescraper/plugins/inband/dkms/dkms_analyzer.py @@ -99,6 +99,8 @@ def analyze_data( if error_state: self.result.status = ExecutionStatus.ERROR - self.result.message = "DKMS data mismatch" + self.result.message = ( + f"DKMS data mismatch. \nActual: {actual_values}.\nExpected: {expected_values}" + ) return self.result