bin: use extract_output_format where necessary

else we sometimes forget to remove it from the 'params' variable
and use that further, running into 'invalid parameter' errors

found by giving 'output-format' paramter to proxmox-tape status

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2021-04-30 14:51:56 +02:00
committed by Dietmar Maurer
parent f0d23e5370
commit 671c6a96e7
3 changed files with 18 additions and 19 deletions

View File

@ -1266,13 +1266,12 @@ async fn prune_async(mut param: Value) -> Result<Value, Error> {
let group = tools::required_string_param(&param, "group")?;
let group: BackupGroup = group.parse()?;
let output_format = get_output_format(&param);
let output_format = extract_output_format(&mut param);
let quiet = param["quiet"].as_bool().unwrap_or(false);
param.as_object_mut().unwrap().remove("repository");
param.as_object_mut().unwrap().remove("group");
param.as_object_mut().unwrap().remove("output-format");
param.as_object_mut().unwrap().remove("quiet");
param["backup-type"] = group.backup_type().into();