another import cleanup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2021-09-01 14:37:11 +02:00
parent 42dad3abd3
commit 4c1b776168
20 changed files with 42 additions and 41 deletions

View File

@ -273,7 +273,7 @@ fn apt_get_changelog(
command.arg("changelog");
command.arg("-qq"); // don't display download progress
command.arg(name);
let output = crate::tools::run_command(command, None)?;
let output = pbs_tools::run_command(command, None)?;
Ok(json!(output))
}
}

View File

@ -244,7 +244,7 @@ pub fn delete_datastore_disk(name: String) -> Result<(), Error> {
// try to unmount, if that fails tell the user to reboot or unmount manually
let mut command = std::process::Command::new("umount");
command.arg(&path);
match crate::tools::run_command(command, None) {
match pbs_tools::run_command(command, None) {
Err(_) => bail!(
"Could not umount '{}' since it is busy. It will stay mounted \
until the next reboot or until unmounted manually!",

View File

@ -356,7 +356,7 @@ pub fn create_zpool(
worker.log(format!("# {:?}", command));
let output = crate::tools::run_command(command, None)?;
let output = pbs_tools::run_command(command, None)?;
worker.log(output);
if std::path::Path::new("/lib/systemd/system/zfs-import@.service").exists() {
@ -368,7 +368,7 @@ pub fn create_zpool(
let mut command = std::process::Command::new("zfs");
command.args(&["set", &format!("compression={}", compression), &name]);
worker.log(format!("# {:?}", command));
let output = crate::tools::run_command(command, None)?;
let output = pbs_tools::run_command(command, None)?;
worker.log(output);
}

View File

@ -39,8 +39,6 @@ const_regex!{
pub SUBSCRIPTION_KEY_REGEX = concat!(r"^pbs(?:[cbsp])-[0-9a-f]{10}$");
pub BLOCKDEVICE_NAME_REGEX = r"^(:?(:?h|s|x?v)d[a-z]+)|(:?nvme\d+n\d+)$";
pub ZPOOL_NAME_REGEX = r"^[a-zA-Z][a-z0-9A-Z\-_.:]+$";
pub DATASTORE_MAP_REGEX = concat!(r"(:?", PROXMOX_SAFE_ID_REGEX_STR!(), r"=)?", PROXMOX_SAFE_ID_REGEX_STR!());