diff --git a/nodescraper/plugins/serviceability/analysis_window.py b/nodescraper/plugins/serviceability/analysis_window.py index 911246e1..d0721f1f 100644 --- a/nodescraper/plugins/serviceability/analysis_window.py +++ b/nodescraper/plugins/serviceability/analysis_window.py @@ -35,7 +35,12 @@ from .analyzer_args import ServiceabilityAnalyzerArgs from .cper_decode import CperDecodeError, decode_cper_raw_attachments from .se_models import AfidEvent, ServiceabilityBlock -from .se_runner import HubRunError, run_entry_point_hub, run_service_hub +from .se_runner import ( + HubRunError, + resolve_runtime_afid_sag_path, + run_entry_point_hub, + run_service_hub, +) from .serviceability_data import ServiceabilityDataModel @@ -161,7 +166,11 @@ def analyze_serviceability_window( error="empty afid_events", ) - sag_path = args.resolved_afid_sag_path() + sag_path = ( + resolve_runtime_afid_sag_path(args, log) + if args.uses_entry_point_hub() + else args.resolved_afid_sag_path() + ) data.afid_sag_path = sag_path log.info( "(%s) Using AFID_SAG file: %s", @@ -191,6 +200,7 @@ def analyze_serviceability_window( rf_event_count=len(data.rf_events), raise_on_error=args.hub_raise_on_error, prefer_rf_events=args.hub_prefer_rf_events and not bool(cper_data), + logger=log, ) except (HubRunError, ValueError) as exc: return ServiceabilityWindowResult( diff --git a/nodescraper/plugins/serviceability/serviceability_data.py b/nodescraper/plugins/serviceability/serviceability_data.py index b77ad3f5..eeb2f6b2 100644 --- a/nodescraper/plugins/serviceability/serviceability_data.py +++ b/nodescraper/plugins/serviceability/serviceability_data.py @@ -37,6 +37,7 @@ from .event_log_utils import rf_events_from_json_payload from .se_models import AfidEvent, ServiceabilityBlock +from .serviceability_api import export_serviceability_json class ServiceabilityDataLoadError(ValueError): @@ -151,15 +152,11 @@ def log_model(self, log_path: str) -> None: with open(cper_path, "w", encoding="utf-8") as f: json.dump(self.cper_data, f, indent=2) if self.serviceability is not None: - serviceability_path = os.path.join(log_path, "serviceability.json") - from .serviceability_api import export_serviceability_json - - with open(serviceability_path, "w", encoding="utf-8") as f: - json.dump( - export_serviceability_json(self.serviceability), - f, - indent=2, - ) + payload = export_serviceability_json(self.serviceability) + if payload is not None: + serviceability_path = os.path.join(log_path, "serviceability.json") + with open(serviceability_path, "w", encoding="utf-8") as f: + json.dump(payload, f, indent=2) from .afid_fru_csv import write_afid_fru_summary_csv write_afid_fru_summary_csv(