From 1c395ad1956057814f8482ea17ef799f0315544c Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 7 Aug 2024 20:51:20 +0200 Subject: [PATCH] client: use proxmox_systemd crate Some systemd code got split out from proxmox-sys and left there re-exported with a deprecation marker, use the newer crate, the workspace already depends on proxmox-systemd anyway. Signed-off-by: Thomas Lamprecht --- proxmox-backup-client/Cargo.toml | 1 + proxmox-backup-client/src/mount.rs | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/proxmox-backup-client/Cargo.toml b/proxmox-backup-client/Cargo.toml index 40de2450..20a67440 100644 --- a/proxmox-backup-client/Cargo.toml +++ b/proxmox-backup-client/Cargo.toml @@ -31,6 +31,7 @@ proxmox-router = { workspace = true, features = [ "cli" ] } proxmox-schema = { workspace = true, features = [ "api-macro" ] } proxmox-sortable-macro.workspace = true proxmox-sys.workspace = true +proxmox-systemd.workspace = true proxmox-time.workspace = true pbs-api-types.workspace = true diff --git a/proxmox-backup-client/src/mount.rs b/proxmox-backup-client/src/mount.rs index 6c75021e..c15e030f 100644 --- a/proxmox-backup-client/src/mount.rs +++ b/proxmox-backup-client/src/mount.rs @@ -16,6 +16,7 @@ use tokio::signal::unix::{signal, SignalKind}; use proxmox_router::{cli::*, ApiHandler, ApiMethod, RpcEnvironment}; use proxmox_schema::*; use proxmox_sortable_macro::sortable; +use proxmox_systemd; use pbs_api_types::BackupNamespace; use pbs_client::tools::has_pxar_filename_extension; @@ -156,7 +157,7 @@ fn complete_mapping_names( ) -> Vec { match pbs_fuse_loop::find_all_mappings() { Ok(mappings) => mappings - .filter_map(|(name, _)| proxmox_sys::systemd::unescape_unit(&name).ok()) + .filter_map(|(name, _)| proxmox_systemd::unescape_unit(&name).ok()) .collect(), Err(_) => Vec::new(), } @@ -326,7 +327,7 @@ async fn mount_do(param: Value, pipe: Option) -> Result { let reader = CachedChunkReader::new(chunk_reader, index, 8).seekable(); let name = &format!("{}:{}/{}", repo, path, archive_name); - let name_escaped = proxmox_sys::systemd::escape_unit(name, false); + let name_escaped = proxmox_systemd::escape_unit(name, false); let mut session = pbs_fuse_loop::FuseLoopSession::map_loop(size, reader, &name_escaped, options).await?; @@ -388,7 +389,7 @@ fn unmap( pbs_fuse_loop::cleanup_unused_run_files(None); let mut any = false; for (backing, loopdev) in pbs_fuse_loop::find_all_mappings()? { - let name = proxmox_sys::systemd::unescape_unit(&backing)?; + let name = proxmox_systemd::unescape_unit(&backing)?; log::info!( "{}:\t{}", loopdev.unwrap_or_else(|| "(unmapped)".to_string()), @@ -411,7 +412,7 @@ fn unmap( if name.starts_with("/dev/loop") { pbs_fuse_loop::unmap_loopdev(name)?; } else { - let name = proxmox_sys::systemd::escape_unit(&name, false); + let name = proxmox_systemd::escape_unit(&name, false); pbs_fuse_loop::unmap_name(name)?; } -- 2.39.5