diff options
author | Petr Viktorin <pviktori@redhat.com> | 2013-01-25 08:42:57 -0500 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2013-03-01 16:59:45 +0100 |
commit | a173957865ecbbf85260ecee99a3c86f7b9fde0c (patch) | |
tree | c4afec930ba64d7c72220ab285735ceeb37537f2 /ipaserver | |
parent | 4779865ea30dba0b5f0594cdc4633b0cc93bf36a (diff) | |
download | freeipa.git-a173957865ecbbf85260ecee99a3c86f7b9fde0c.tar.gz freeipa.git-a173957865ecbbf85260ecee99a3c86f7b9fde0c.tar.xz freeipa.git-a173957865ecbbf85260ecee99a3c86f7b9fde0c.zip |
Remove toTupleList and attrList from LDAPEntry
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
Diffstat (limited to 'ipaserver')
-rw-r--r-- | ipaserver/install/ldapupdate.py | 6 | ||||
-rw-r--r-- | ipaserver/ipaldap.py | 15 |
2 files changed, 2 insertions, 19 deletions
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py index de1298d8..16a47a88 100644 --- a/ipaserver/install/ldapupdate.py +++ b/ipaserver/install/ldapupdate.py @@ -673,9 +673,7 @@ class LDAPUpdate: if message: self.debug("%s", message) self.debug("dn: %s", e.dn) - attr = e.attrList() - for a in attr: - value = e.get(a) + for a, value in e.items(): if isinstance(value, (list, tuple)): self.debug('%s:', a) for l in value: @@ -766,7 +764,7 @@ class LDAPUpdate: # entry.orig_data = {} try: if self.live_run: - if len(entry.toTupleList()) > 0: + if len(entry): # addifexist may result in an entry with only a # dn defined. In that case there is nothing to do. # It means the entry doesn't exist, so skip it. diff --git a/ipaserver/ipaldap.py b/ipaserver/ipaldap.py index 78021201..05205808 100644 --- a/ipaserver/ipaldap.py +++ b/ipaserver/ipaldap.py @@ -719,17 +719,6 @@ class LDAPEntry(dict): yield self._dn yield self - def toTupleList(self): - # FIXME: for backwards compatibility only - """Convert the attrs and values to a list of 2-tuples. The first element - of the tuple is the attribute name. The second element is either a - single value or a list of values.""" - r = [] - for i in self.data.iteritems(): - n = ipautil.utf8_encode_values(i[1]) - r.append((i[0], n)) - return r - def toDict(self): # FIXME: for backwards compatibility only """Convert the attrs and values to a dict. The dict is keyed on the @@ -741,10 +730,6 @@ class LDAPEntry(dict): result['dn'] = self.dn return result - def attrList(self): - """Return a list of all attributes in the entry""" - return self.data.keys() - def origDataDict(self): """Returns a dict of the original values of the user. |