summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/baseldap.py
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2013-06-25 12:58:37 +0000
committerAlexander Bokovoy <abokovoy@redhat.com>2013-07-11 12:39:25 +0300
commit100f13d95b51ab5b8a2a4b7dfb04c5f3b58015d4 (patch)
tree27bf5a35b396177642ccfee3bfe5b210dcdc7c52 /ipalib/plugins/baseldap.py
parentab96ca7831ad8ab2ee2389093ea8b9327d94d6f0 (diff)
downloadfreeipa-100f13d95b51ab5b8a2a4b7dfb04c5f3b58015d4.tar.gz
freeipa-100f13d95b51ab5b8a2a4b7dfb04c5f3b58015d4.tar.xz
freeipa-100f13d95b51ab5b8a2a4b7dfb04c5f3b58015d4.zip
Use LDAP search instead of *group_show to check if a group exists.
https://fedorahosted.org/freeipa/ticket/3706
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r--ipalib/plugins/baseldap.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index bb0de989c..13121071d 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -493,6 +493,11 @@ class LDAPObject(Object):
assert isinstance(parent_dn, DN)
return parent_dn
+ def get_dn_if_exists(self, *keys, **kwargs):
+ dn = self.get_dn(*keys, **kwargs)
+ entry = self.backend.get_entry(dn, [''])
+ return entry.dn
+
def get_primary_key_from_dn(self, dn):
assert isinstance(dn, DN)
try: