diff --git a/lib/src/cli.rs b/lib/src/cli.rs index 19b168fc..649ac019 100644 --- a/lib/src/cli.rs +++ b/lib/src/cli.rs @@ -612,9 +612,7 @@ fn prepare_for_write() -> Result<()> { if ostree_ext::container_utils::running_in_container() { anyhow::bail!("Detected container; this command requires a booted host system."); } - if !is_ostree_booted()? { - anyhow::bail!("This command requires an ostree-booted host system"); - } + anyhow::ensure!(ostree_booted()?, "This command requires an ostree-booted host system"); crate::cli::require_root()?; ensure_self_unshared_mount_namespace()?; if crate::lsm::selinux_enabled()? && !crate::lsm::selinux_ensure_install()? {