Skip to content

Commit ef46519

Browse files
committed
nicer support bundle collector type conversions
1 parent 83e969e commit ef46519

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

nexus/src/app/background/tasks/support_bundle_collector.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use gateway_client::types::SpIgnition;
2323
use gateway_types::component::SpType;
2424
use internal_dns_resolver::Resolver;
2525
use internal_dns_types::names::ServiceName;
26-
use nexus_db_model::Ereport;
2726
use nexus_db_model::Sled;
2827
use nexus_db_model::SupportBundle;
2928
use nexus_db_model::SupportBundleState;
@@ -35,7 +34,7 @@ use nexus_db_queries::db::datastore::EreportFilters;
3534
use nexus_db_queries::db::pagination::Paginator;
3635
use nexus_reconfigurator_preparation::reconfigurator_state_load;
3736
use nexus_types::deployment::SledFilter;
38-
37+
use nexus_types::fm::Ereport;
3938
use nexus_types::identity::Asset;
4039
use nexus_types::internal_api::background::SupportBundleCleanupReport;
4140
use 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

Comments
 (0)