Skip to content

Commit fa6bde3

Browse files
committed
status: print if soft-reboot capable on --verbose
1 parent 81ed850 commit fa6bde3

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

crates/lib/src/cli.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,12 +748,12 @@ fn should_soft_reboot(
748748
) -> Result<bool> {
749749
// Get updated status to check for soft-reboot capability
750750
let (_deployments, updated_host) = crate::status::get_status(sysroot, booted_deployment)?;
751-
751+
752752
// Check if there's a staged deployment that can perform soft reboot
753753
if can_perform_soft_reboot(updated_host.status.staged.as_ref()) {
754754
soft_reboot_staged(sysroot)?;
755755
return Ok(true);
756-
}
756+
}
757757
// TODO check if this reboot is doing a rollback...
758758
// TODO then perform a soft reboot for the rollback deployment
759759
Ok(false)

crates/lib/src/status.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,18 @@ fn human_render_slot(
467467
}
468468
}
469469
}
470+
471+
// Show soft-reboot capability
472+
write_row_name(&mut out, "Soft-reboot capable", prefix_len)?;
473+
writeln!(
474+
out,
475+
"{}",
476+
if entry.soft_reboot_capable {
477+
"yes"
478+
} else {
479+
"no"
480+
}
481+
)?;
470482
}
471483

472484
tracing::debug!("pinned={}", entry.pinned);
@@ -504,6 +516,18 @@ fn human_render_slot_ostree(
504516
if let Some(ostree) = &entry.ostree {
505517
render_verbose_ostree_info(&mut out, ostree, slot, prefix_len)?;
506518
}
519+
520+
// Show soft-reboot capability
521+
write_row_name(&mut out, "Soft-reboot capable", prefix_len)?;
522+
writeln!(
523+
out,
524+
"{}",
525+
if entry.soft_reboot_capable {
526+
"yes"
527+
} else {
528+
"no"
529+
}
530+
)?;
507531
}
508532

509533
tracing::debug!("pinned={}", entry.pinned);
@@ -725,5 +749,6 @@ mod tests {
725749
assert!(w.contains("Deploy serial:"));
726750
assert!(w.contains("Staged:"));
727751
assert!(w.contains("Commit:"));
752+
assert!(w.contains("Soft-reboot capable:"));
728753
}
729754
}

0 commit comments

Comments
 (0)