summaryrefslogtreecommitdiffstats
path: root/ipaserver/install
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2013-12-10 11:42:35 +0100
committerPetr Viktorin <pviktori@redhat.com>2014-01-10 14:41:39 +0100
commit9d4bcb63dead51e927ac2a4b554ee0d98aed052f (patch)
treea4e1cb083a3ad318fa7d17ee3ceea35844299825 /ipaserver/install
parent21fab665f482445ebcdcedffad7182acdb02fa28 (diff)
downloadfreeipa-9d4bcb63dead51e927ac2a4b554ee0d98aed052f.tar.gz
freeipa-9d4bcb63dead51e927ac2a4b554ee0d98aed052f.tar.xz
freeipa-9d4bcb63dead51e927ac2a4b554ee0d98aed052f.zip
Reduce amount of LDAPEntry.reset_modlist calls in ldapupdate.
https://fedorahosted.org/freeipa/ticket/3488
Diffstat (limited to 'ipaserver/install')
-rw-r--r--ipaserver/install/ldapupdate.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py
index 97d7a355..087cfcfd 100644
--- a/ipaserver/install/ldapupdate.py
+++ b/ipaserver/install/ldapupdate.py
@@ -279,11 +279,6 @@ class LDAPUpdate:
if fd != sys.stdin: fd.close()
return text
- def _entry_to_entity(self, ent):
- entry = ent.copy()
- entry.reset_modlist()
- return entry
-
def _combine_updates(self, all_updates, update):
'Combine a new update with the list of total updates'
dn = update.get('dn')
@@ -518,7 +513,7 @@ class LDAPUpdate:
if not default:
# This means that the entire entry needs to be created with add
- return self._entry_to_entity(entry)
+ return entry
for item in default:
# We already do syntax-parsing so this is safe
@@ -531,8 +526,9 @@ class LDAPUpdate:
else:
e = [value]
entry[attr] = e
+ entry.reset_modlist()
- return self._entry_to_entity(entry)
+ return entry
def _get_entry(self, dn):
"""Retrieve an object from LDAP.
@@ -672,7 +668,7 @@ class LDAPUpdate:
if len(e) > 1:
# we should only ever get back one entry
raise BadSyntax, "More than 1 entry returned on a dn search!? %s" % new_entry.dn
- entry = self._entry_to_entity(e[0])
+ entry = e[0]
found = True
self.info("Updating existing entry: %s", entry.dn)
except errors.NotFound: