Collect capacity for every Windows fixed drive letter
Rust development slice / linux (push) Failing after 11s
Rust development slice / linux (push) Failing after 11s
This commit is contained in:
@@ -3230,9 +3230,11 @@ pub fn main() -> Result<()> {
|
||||
let runtime = tokio::runtime::Runtime::new()?;
|
||||
let (boot, booted_at) = runtime.block_on(native::boot_identity())?;
|
||||
let inventory = native::snapshot_with_boot(Some(booted_at))?;
|
||||
let drives = inventory["observations"].as_array().and_then(|observations|
|
||||
observations.iter().find(|o| o["scope"] == "windows.volumes")).map(|o| &o["data"]["drives"]);
|
||||
println!(
|
||||
"{}",
|
||||
serde_json::json!({"platform":"windows","architecture":std::env::consts::ARCH,"hostname_available":!inventory["hostname"].as_str().unwrap_or("").is_empty(),"system_volume_available":inventory["root_available_bytes"].as_u64().is_some(),"inodes":null,"boot_id":boot,"capabilities":CAPABILITIES,"jobs_supported":false})
|
||||
serde_json::json!({"platform":"windows","architecture":std::env::consts::ARCH,"hostname_available":!inventory["hostname"].as_str().unwrap_or("").is_empty(),"system_volume_available":inventory["root_available_bytes"].as_u64().is_some(),"fixed_volumes":drives,"inodes":null,"boot_id":boot,"capabilities":CAPABILITIES,"jobs_supported":false})
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user