fn invoke_cli_deploy(release: Release, allow_downgrade: bool) -> Result<Release> {
    fail_point!("deploy_locked_err", |_| bail!("deploy_locked_err"));
    fail_point!("deploy_locked_ok", |_| Ok(release.clone()));

    let mut cmd = std::process::Command::new("rpm-ostree");
    cmd.arg("deploy")
        .arg("--lock-finalization")
        .arg("--skip-branch-check")
        .arg(format!("revision={}", release.checksum))
        .env("RPMOSTREE_CLIENT_ID", "zincati");
    if !allow_downgrade {
        cmd.arg("--disallow-downgrade");
    }

    let out = cmd.output().context("failed to run 'rpm-ostree' binary")?;

    if !out.status.success() {
        bail!(
            "rpm-ostree deploy failed:\n{}",
            String::from_utf8_lossy(&out.stderr)
        );
    }
    Ok(release)
}
/// CLI executor for deploying upgrades.
CLI executor for deploying upgrades.
CLI executor for deploying upgrades .
fn invoke_cli_deploy(release: Release, allow_downgrade: bool) -> Result<Release> {
    fail_point!("deploy_locked_err", |_| bail!("deploy_locked_err"));
    fail_point!("deploy_locked_ok", |_| Ok(release.clone()));
    let mut cmd = std::process::Command::new("rpm-ostree");
    cmd.arg("deploy")
        .arg("--lock-finalization")
        .arg("--skip-branch-check")
        .arg(format!("revision={}", release.checksum))
        .env("RPMOSTREE_CLIENT_ID", "zincati");
    if !allow_downgrade {
        cmd.arg("--disallow-downgrade");
    }
    let out = cmd.output().context("failed to run 'rpm-ostree' binary")?;
    if !out.status.success() {
        bail!(
            "rpm-ostree deploy failed:\n{}",
            String::from_utf8_lossy(&out.stderr)
        );
    }
    Ok(release)
}
fn invoke_cli_deploy ( release : Release , allow_downgrade : bool ) -> Result < Release > { fail_point ! ( " " bail ( " " ) ) ; fail_point ! ( " " Ok ( release clone ( ) ) ) ; let mut cmd = std :: process :: Command :: new ( " " ) ; cmd . arg ( " " ) . arg ( " " ) . arg ( " " ) . arg ( format ! ( " " release checksum ) ) . env ( " " , " " ) ; if ! allow_downgrade { cmd . arg ( " " ) ; } let out = cmd . output ( ) . context ( " " ) ? ; if ! out . status . success ( ) { bail ! ( " \n " String from_utf8_lossy ( out stderr ) ) ; } Ok ( release ) }
CLI executor for deploying upgrades.
CLI executor for deploying upgrades .
release
Release
allow_downgrade
bool