difftreelog
fix remote copy
2 files changed
cmds/fleet/src/cmds/build_systems.rsdiffbeforeafterboth1use std::{env::current_dir, os::unix::fs::symlink, path::PathBuf};1use std::{env::current_dir, os::unix::fs::symlink};223use anyhow::Result;3use anyhow::Result;4use camino::Utf8PathBuf;4use camino::Utf8PathBuf;101impl Deploy {101impl Deploy {102 pub async fn run(self, config: &Config, opts: &FleetOpts) -> Result<()> {102 pub async fn run(self, config: &Config, opts: &FleetOpts) -> Result<()> {103 let hosts = opts.filter_skipped(config.list_hosts()?)?;103 let hosts = opts.filter_skipped(config.list_hosts()?)?;104 let mut tasks = FuturesUnordered::new();104 let tasks = FuturesUnordered::new();105 for host in hosts.into_iter() {105 for host in hosts.into_iter() {106 let config = config.clone();106 let config = config.clone();107 let span = info_span!("deploy", host = field::display(&host.name));107 let span = info_span!("deploy", host = field::display(&host.name));crates/fleet-base/src/host.rsdiffbeforeafterboth--- a/crates/fleet-base/src/host.rs
+++ b/crates/fleet-base/src/host.rs
@@ -24,7 +24,7 @@
use tempfile::NamedTempFile;
use time::UtcDateTime;
use tokio::task::spawn_blocking;
-use tracing::{info, warn};
+use tracing::warn;
use crate::fleetdata::{
FleetData, FleetSecretData, FleetSecretDistribution, FleetSecretPart, SecretOwner,
@@ -282,7 +282,7 @@
/// Client for this host's unprivileged agent.
pub async fn remowt(&self) -> Result<Remowt> {
- Ok(self.connection().await?)
+ self.connection().await
}
pub fn ensure_nix_plugin(&self) -> Pin<Box<dyn Future<Output = Result<u16>> + Send + '_>> {
@@ -310,7 +310,7 @@
.rpc()
.wait_for_connection_to(Address::Plugin(NIX_PLUGIN_ID))
.await
- .map_err(|e| anyhow!("failed to wait for plugin"))?;
+ .map_err(|_| anyhow!("failed to wait for plugin"))?;
anyhow::Ok(())
})
.await?;
@@ -427,8 +427,8 @@
let store = self.nix_store().await?;
{
let path = path.clone();
- let store = eval_store();
- spawn_blocking(move || store.copy_to(&store, path.as_ref()))
+ let eval_store = eval_store();
+ spawn_blocking(move || eval_store.copy_to(&store, path.as_ref()))
.await
.expect("copy_to panicked")
.context("copying closure to remote store")?;