MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / print_policy_revision_table

Function print_policy_revision_table

crates/openshell-cli/src/run.rs:7362–7388  ·  view source on GitHub ↗
(revisions: &[openshell_core::proto::SandboxPolicyRevision])

Source from the content-addressed store, hash-verified

7360}
7361
7362fn print_policy_revision_table(revisions: &[openshell_core::proto::SandboxPolicyRevision]) {
7363 println!(
7364 "{:<8} {:<14} {:<12} {:<24} ERROR",
7365 "VERSION", "HASH", "STATUS", "CREATED"
7366 );
7367 for rev in revisions {
7368 let status = PolicyStatus::try_from(rev.status).unwrap_or(PolicyStatus::Unspecified);
7369 let hash_short = if rev.policy_hash.len() >= 12 {
7370 &rev.policy_hash[..12]
7371 } else {
7372 &rev.policy_hash
7373 };
7374 let error_short = if rev.load_error.len() > 40 {
7375 format!("{}...", &rev.load_error[..40])
7376 } else {
7377 rev.load_error.clone()
7378 };
7379 println!(
7380 "{:<8} {:<14} {:<12} {:<24} {}",
7381 rev.version,
7382 hash_short,
7383 format!("{status:?}"),
7384 rev.created_at_ms,
7385 error_short,
7386 );
7387 }
7388}
7389
7390// ---------------------------------------------------------------------------
7391// Sandbox logs command

Callers 2

sandbox_policy_listFunction · 0.85

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected