@@ -232,24 +232,29 @@ def collect_data(
232232 self .result .status = ExecutionStatus .NOT_RAN
233233 return self .result , None
234234
235- # Filter and log ROCm packages if on Linux
235+ # Filter and log ROCm packages if on Linux and rocm_regex is provided
236236 if self .system_info .os_family == OSFamily .LINUX and packages :
237- # Get ROCm pattern from args or use default
238- rocm_pattern = args .rocm_regex if args else PackageAnalyzerArgs ().rocm_regex
239- self .logger .info ("Using rocm_pattern: %s" , rocm_pattern )
240- rocm_packages = self ._filter_rocm_packages (packages , rocm_pattern )
241- if rocm_packages :
242- self .result .message = f"Found { len (rocm_packages )} ROCm-related packages installed"
243- self .result .status = ExecutionStatus .OK
244- self ._log_event (
245- category = EventCategory .OS ,
246- description = f"Found { len (rocm_packages )} ROCm-related packages installed" ,
247- priority = EventPriority .INFO ,
248- data = {"rocm_packages" : sorted (rocm_packages .keys ())},
249- )
237+ # Get ROCm pattern from args if provided
238+ rocm_pattern = args .rocm_regex if args else None
239+ if rocm_pattern :
240+ self .logger .info ("Using rocm_pattern: %s" , rocm_pattern )
241+ rocm_packages = self ._filter_rocm_packages (packages , rocm_pattern )
242+ if rocm_packages :
243+ self .result .message = (
244+ f"Found { len (rocm_packages )} ROCm-related packages installed"
245+ )
246+ self .result .status = ExecutionStatus .OK
247+ self ._log_event (
248+ category = EventCategory .OS ,
249+ description = f"Found { len (rocm_packages )} ROCm-related packages installed" ,
250+ priority = EventPriority .INFO ,
251+ data = {"rocm_packages" : sorted (rocm_packages .keys ())},
252+ )
253+ else :
254+ self .logger .info ("No rocm_regex provided, skipping ROCm package filtering" )
250255
251256 # Extract rocm_regex and enable_rocm_regex from args if provided
252- rocm_regex = args .rocm_regex if args else ""
257+ rocm_regex = args .rocm_regex if ( args and args . rocm_regex ) else ""
253258 enable_rocm_regex = getattr (args , "enable_rocm_regex" , False ) if args else False
254259
255260 try :
0 commit comments