api2: datastore/delete_group: throw error for partially removed group

when a group could not be completely removed due to protected snapshot,
throw an error

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-10-27 13:22:32 +02:00 committed by Wolfgang Bumiller
parent 343392613d
commit 5cc7d89139

View File

@ -272,7 +272,9 @@ pub fn delete_group(
check_priv_or_backup_owner(&datastore, &group, &auth_id, PRIV_DATASTORE_MODIFY)?;
datastore.remove_backup_group(&group)?;
if !datastore.remove_backup_group(&group)? {
bail!("did not delete whole group because of protected snapthots");
}
Ok(Value::Null)
}