summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2015-09-17 11:14:54 +0200
committerPetr Vobornik <pvoborni@redhat.com>2015-09-17 14:55:54 +0200
commit2964b019d93b33b9703e6e26c8ca6fc28509ba64 (patch)
treebdc5b3839fa3611cee9be1f0c66f480881c26c06
parent33aba6f35e43b5febf1751de4cef2863749f93e7 (diff)
downloadfreeipa-2964b019d93b33b9703e6e26c8ca6fc28509ba64.tar.gz
freeipa-2964b019d93b33b9703e6e26c8ca6fc28509ba64.tar.xz
freeipa-2964b019d93b33b9703e6e26c8ca6fc28509ba64.zip
baseldap: make subtree deletion optional in LDAPDelete
https://fedorahosted.org/freeipa/ticket/5250 Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
-rw-r--r--ipalib/plugins/baseldap.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 4a0224647..46809f004 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -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)