Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions nodescraper/plugins/serviceability/analysis_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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(
Expand Down
15 changes: 6 additions & 9 deletions nodescraper/plugins/serviceability/serviceability_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down
Loading