mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-24 14:17:41 -05:00
baseldap: make subtree deletion optional in LDAPDelete
https://fedorahosted.org/freeipa/ticket/5250 Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
1 parent
33aba6f35e
commit
2964b019d9
1 file changed
+4
@@ -1570,6 +1570,8 @@ class LDAPDelete(LDAPMultiQuery):
|
||||
|
||||
has_output_params = global_output_params
|
||||
|
||||
subtree_delete = True
|
||||
|
||||
def execute(self, *keys, **options):
|
||||
ldap = self.obj.backend
|
||||
|
||||
@@ -1605,6 +1607,8 @@ class LDAPDelete(LDAPMultiQuery):
|
||||
except errors.NotFound:
|
||||
self.obj.handle_not_found(*nkeys)
|
||||
except errors.NotAllowedOnNonLeaf:
|
||||
if not self.subtree_delete:
|
||||
raise
|
||||
# this entry is not a leaf entry, delete all child nodes
|
||||
delete_subtree(dn)
|
||||
|
||||
|
||||
Reference in new issue
Block a user