]> git.proxmox.com Git - proxmox-backup.git/commitdiff
api2: datastore/delete_group: throw error for partially removed group
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 27 Oct 2021 11:22:32 +0000 (13:22 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 28 Oct 2021 09:31:07 +0000 (11:31 +0200)
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>
src/api2/admin/datastore.rs

index b739d430b178cfa8c960a7f37010375f4c234dcf..fe962e4e82906ac194169e6f5020e090ec462d56 100644 (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)
 }