@@ -23,7 +23,6 @@ use gateway_client::types::SpIgnition;
2323use gateway_types:: component:: SpType ;
2424use internal_dns_resolver:: Resolver ;
2525use internal_dns_types:: names:: ServiceName ;
26- use nexus_db_model:: Ereport ;
2726use nexus_db_model:: Sled ;
2827use nexus_db_model:: SupportBundle ;
2928use nexus_db_model:: SupportBundleState ;
@@ -35,7 +34,7 @@ use nexus_db_queries::db::datastore::EreportFilters;
3534use nexus_db_queries:: db:: pagination:: Paginator ;
3635use nexus_reconfigurator_preparation:: reconfigurator_state_load;
3736use nexus_types:: deployment:: SledFilter ;
38-
37+ use nexus_types :: fm :: Ereport ;
3938use nexus_types:: identity:: Asset ;
4039use nexus_types:: internal_api:: background:: SupportBundleCleanupReport ;
4140use nexus_types:: internal_api:: background:: SupportBundleCollectionReport ;
@@ -1203,11 +1202,10 @@ async fn write_ereport(ereport: Ereport, dir: &Utf8Path) -> anyhow::Result<()> {
12031202 tokio:: fs:: create_dir_all ( & dir)
12041203 . await
12051204 . with_context ( || format ! ( "failed to create directory '{dir}'" ) ) ?;
1206- let ereport_id = ereport. id ( ) ;
1207- let file_path = dir. join ( format ! ( "{}.json" , ereport_id. ena) ) ;
1208- let ereport = nexus_types:: fm:: Ereport :: from ( ereport) ;
1209- let json = serde_json:: to_vec ( & ereport)
1210- . with_context ( || format ! ( "failed to serialize ereport {ereport_id}" ) ) ?;
1205+ let file_path = dir. join ( format ! ( "{}.json" , ereport. id. ena) ) ;
1206+ let json = serde_json:: to_vec ( & ereport) . with_context ( || {
1207+ format ! ( "failed to serialize ereport {pn}:{sn}/{}" , ereport. id)
1208+ } ) ?;
12111209 tokio:: fs:: write ( & file_path, json)
12121210 . await
12131211 . with_context ( || format ! ( "failed to write '{file_path}'" ) )
0 commit comments