use UPID and systemd helpers from proxmox 0.13.4
This commit is contained in:
@ -242,7 +242,7 @@ pub fn delete_datastore_disk(name: String) -> Result<(), Error> {
|
||||
}
|
||||
|
||||
// disable systemd mount-unit
|
||||
let mut mount_unit_name = proxmox_systemd::escape_unit(&path, true);
|
||||
let mut mount_unit_name = proxmox::tools::systemd::escape_unit(&path, true);
|
||||
mount_unit_name.push_str(".mount");
|
||||
proxmox_systemd::disable_unit(&mount_unit_name)?;
|
||||
|
||||
@ -281,7 +281,7 @@ fn create_datastore_mount_unit(
|
||||
what: &str,
|
||||
) -> Result<String, Error> {
|
||||
|
||||
let mut mount_unit_name = proxmox_systemd::escape_unit(&mount_point, true);
|
||||
let mut mount_unit_name = proxmox::tools::systemd::escape_unit(&mount_point, true);
|
||||
mount_unit_name.push_str(".mount");
|
||||
|
||||
let mount_unit_path = format!("/etc/systemd/system/{}", mount_unit_name);
|
||||
|
@ -271,7 +271,7 @@ pub fn create_zpool(
|
||||
worker.log(output);
|
||||
|
||||
if std::path::Path::new("/lib/systemd/system/zfs-import@.service").exists() {
|
||||
let import_unit = format!("zfs-import@{}.service", proxmox_systemd::escape_unit(&name, false));
|
||||
let import_unit = format!("zfs-import@{}.service", proxmox::tools::systemd::escape_unit(&name, false));
|
||||
proxmox_systemd::enable_unit(&import_unit)?;
|
||||
}
|
||||
|
||||
|
@ -18,9 +18,9 @@ use once_cell::sync::OnceCell;
|
||||
use proxmox::sys::linux::procfs;
|
||||
use proxmox::try_block;
|
||||
use proxmox::tools::fs::{create_path, replace_file, atomic_open_or_create_file, CreateOptions};
|
||||
use proxmox::api::upid::UPID;
|
||||
|
||||
use pbs_tools::logrotate::{LogRotate, LogRotateFiles};
|
||||
use pbs_api_types::UPID;
|
||||
use proxmox_rest_server::{CommandoSocket, FileLogger, FileLogOptions};
|
||||
|
||||
struct TaskListLockGuard(File);
|
||||
|
@ -606,7 +606,7 @@ pub struct DeviceLockGuard(std::fs::File);
|
||||
// Uses systemd escape_unit to compute a file name from `device_path`, the try
|
||||
// to lock `/var/lock/<name>`.
|
||||
fn open_device_lock(device_path: &str) -> Result<std::fs::File, Error> {
|
||||
let lock_name = proxmox_systemd::escape_unit(device_path, true);
|
||||
let lock_name = proxmox::tools::systemd::escape_unit(device_path, true);
|
||||
|
||||
let mut path = std::path::PathBuf::from(crate::tape::DRIVE_LOCK_DIR);
|
||||
path.push(lock_name);
|
||||
|
Reference in New Issue
Block a user