From 5cc7d891397fcd9569f1adbd7e3f1750502e007a Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Wed, 27 Oct 2021 13:22:32 +0200 Subject: [PATCH] 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 Signed-off-by: Wolfgang Bumiller --- 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 b739d430..fe962e4e 100644 --- a/src/api2/admin/datastore.rs +++ b/src/api2/admin/datastore.rs @@ -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) }