summaryrefslogtreecommitdiffstats
path: root/ipaserver/ipaldap.py
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2013-01-22 09:28:25 +0100
committerMartin Kosek <mkosek@redhat.com>2013-03-01 16:59:43 +0100
commit8d92ca851c6a0d3380ddbe13c3b442adab274f93 (patch)
tree333e840dcd564035013b5cfa31115ffe1baf9e1b /ipaserver/ipaldap.py
parentd9b3c91d47b246f2bafbe290c4988d0faf3a8cea (diff)
downloadfreeipa-8d92ca851c6a0d3380ddbe13c3b442adab274f93.tar.gz
freeipa-8d92ca851c6a0d3380ddbe13c3b442adab274f93.tar.xz
freeipa-8d92ca851c6a0d3380ddbe13c3b442adab274f93.zip
Add make_entry factory method to LDAPConnection.
Replace all occurences of Entry instantiation with calls to make_entry.
Diffstat (limited to 'ipaserver/ipaldap.py')
-rw-r--r--ipaserver/ipaldap.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/ipaserver/ipaldap.py b/ipaserver/ipaldap.py
index 40d9f9e83..e3c74f83d 100644
--- a/ipaserver/ipaldap.py
+++ b/ipaserver/ipaldap.py
@@ -961,6 +961,9 @@ class LDAPConnection(object):
parent_dn = self.normalize_dn(parent_dn)
return DN((primary_key, entry_attrs[primary_key]), parent_dn)
+ def make_entry(self, _dn=None, _obj=None, **kwargs):
+ return LDAPEntry(_dn, _obj, **kwargs)
+
# generating filters for find_entry
# some examples:
# f1 = ldap2.make_filter_from_attr(u'firstName', u'Pavel')
@@ -1651,6 +1654,10 @@ class IPAdmin(LDAPConnection):
self.__bind_with_wait(self.sasl_interactive_bind_s, timeout, None, auth_tokens)
self.__lateinit()
+ def make_entry(self, _dn=None, _obj=None, **kwargs):
+ entry = super(IPAdmin, self).make_entry(_dn, _obj, **kwargs)
+ return Entry((entry.dn, entry))
+
def getEntry(self, base, scope, filterstr='(objectClass=*)',
attrlist=None):
# FIXME: for backwards compatibility only