namespace deletion: propagate delete-groups=false but ENOTEMPTY as error
after all we couldn't delete all that got requested, ideally this should become a task where we can log what got deleted and what not... Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
60b9676fa2
commit
3aafa61362
@ -487,6 +487,7 @@ impl DataStore {
|
||||
log::debug!("namespace {ns} already removed")
|
||||
}
|
||||
Err(nix::Error::Sys(nix::errno::Errno::ENOTEMPTY)) if !delete_groups => {
|
||||
removed_all_requested = false;
|
||||
log::debug!("skip removal of non-empty namespace {ns}")
|
||||
}
|
||||
Err(err) => {
|
||||
|
@ -168,7 +168,11 @@ pub fn delete_namespace(
|
||||
let datastore = DataStore::lookup_datastore(&store, Some(Operation::Write))?;
|
||||
|
||||
if !datastore.remove_namespace_recursive(&ns, delete_groups)? {
|
||||
bail!("group only partially deleted due to protected snapshots");
|
||||
if delete_groups {
|
||||
bail!("group only partially deleted due to protected snapshots");
|
||||
} else {
|
||||
bail!("only partially deleted due to existing groups but `delete-groups` not true ");
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Value::Null)
|
||||
|
Loading…
Reference in New Issue
Block a user