[pbs-devel] [PATCH proxmox-backup v2 07/13] api2: datastore/delete_group: throw error for partially removed group
Dominik Csapak
d.csapak at proxmox.com
Thu Sep 23 13:37:33 CEST 2021
when a group could not be completely removed due to protected snapshot,
throw an error
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
src/api2/admin/datastore.rs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
index 7390a62f..04320f9c 100644
--- a/src/api2/admin/datastore.rs
+++ b/src/api2/admin/datastore.rs
@@ -270,7 +270,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)
}
--
2.30.2
More information about the pbs-devel
mailing list