client: rename --backup-ns to --ns in backup command

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-05-12 10:43:56 +02:00
parent 5225817de6
commit 03d4f43d5a
1 changed files with 2 additions and 8 deletions

View File

@ -606,7 +606,7 @@ fn spawn_catalog_upload(
optional: true, optional: true,
default: false, default: false,
}, },
"backup-ns": { "ns": {
schema: BACKUP_NAMESPACE_SCHEMA, schema: BACKUP_NAMESPACE_SCHEMA,
optional: true, optional: true,
}, },
@ -703,13 +703,7 @@ async fn create_backup(
.as_str() .as_str()
.unwrap_or(proxmox_sys::nodename()); .unwrap_or(proxmox_sys::nodename());
let backup_ns: BackupNamespace = match param.get("backup-ns") { let backup_ns = optional_ns_param(&param)?;
Some(ns) => ns
.as_str()
.ok_or_else(|| format_err!("bad namespace {:?}", ns))?
.parse()?,
None => BackupNamespace::root(),
};
let backup_type: BackupType = param["backup-type"].as_str().unwrap_or("host").parse()?; let backup_type: BackupType = param["backup-type"].as_str().unwrap_or("host").parse()?;