src/bin/proxmox-backup-client.rs: fixup - correctly pass prune parameters

This commit is contained in:
Dietmar Maurer 2019-07-27 09:24:23 +02:00
parent 9fdc3ef46f
commit ea7a7ef299
1 changed files with 7 additions and 5 deletions

View File

@ -840,7 +840,7 @@ fn upload_log(
} }
fn prune( fn prune(
param: Value, mut param: Value,
_info: &ApiMethod, _info: &ApiMethod,
_rpcenv: &mut dyn RpcEnvironment, _rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> { ) -> Result<Value, Error> {
@ -854,11 +854,13 @@ fn prune(
let group = tools::required_string_param(&param, "group")?; let group = tools::required_string_param(&param, "group")?;
let group = BackupGroup::parse(group)?; let group = BackupGroup::parse(group)?;
let mut args = json!({}); param.as_object_mut().unwrap().remove("repository");
args["backup-type"] = group.backup_type().into(); param.as_object_mut().unwrap().remove("group");
args["backup-id"] = group.backup_id().into();
let result = client.post(&path, Some(args)).wait()?; param["backup-type"] = group.backup_type().into();
param["backup-id"] = group.backup_id().into();
let result = client.post(&path, Some(param)).wait()?;
record_repository(&repo); record_repository(&repo);