From 8cd08a619b275155e21d71c1368a73c8814a8640 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Thu, 17 Sep 2015 11:14:54 +0200 Subject: [PATCH] baseldap: make subtree deletion optional in LDAPDelete https://fedorahosted.org/freeipa/ticket/5250 Reviewed-By: Petr Vobornik --- ipalib/plugins/baseldap.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 31f38946afcbb51638bcab68a6e74ec309eba0e4..15b6bb2365705bb6b0dc0df258c6a5b59c4b7d8d 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -1565,6 +1565,8 @@ class LDAPDelete(LDAPMultiQuery): has_output_params = global_output_params + subtree_delete = True + def execute(self, *keys, **options): ldap = self.obj.backend @@ -1600,6 +1602,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) -- 2.4.3