summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-02-06 18:22:33 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-02-06 18:22:33 +0000
commit012c5e29572aef7747f2a4ce54b09d4b1eb79703 (patch)
tree3b5cc3e345c7674310e439e6e070b50104d904e7 /pykolab
parent6e4ec59549461c2a333ec032ed8ee1238de75347 (diff)
downloadpykolab-012c5e29572aef7747f2a4ce54b09d4b1eb79703.tar.gz
Ensure that when new aliases are being compared to the old ones, the lists are compared in a sorted, list-over-set manner. (#1560)
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/auth/ldap/__init__.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 16c0688..e0128cc 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -767,16 +767,25 @@ class LDAP(pykolab.base.Base):
entry_modifications[secondary_mail_attribute] = secondary_mail_addresses
else:
if isinstance(entry[secondary_mail_attribute], basestring):
- entry[secondary_mail_attribute] = list(set([entry[secondary_mail_attribute]]))
+ entry[secondary_mail_attribute] = [entry[secondary_mail_attribute]]
+
+ log.debug(_("secondary_mail_addresses: %r") % (secondary_mail_addresses), level=8)
+ log.debug(_("entry[%s]: %r") % (secondary_mail_attribute,entry[secondary_mail_attribute]), level=8)
+
+ secondary_mail_addresses.sort()
+ entry[secondary_mail_attribute].sort()
+
+ log.debug(_("secondary_mail_addresses: %r") % (secondary_mail_addresses), level=8)
+ log.debug(_("entry[%s]: %r") % (secondary_mail_attribute,entry[secondary_mail_attribute]), level=8)
if not list(set(secondary_mail_addresses)) == list(set(entry[secondary_mail_attribute])):
self.set_entry_attribute(
entry,
secondary_mail_attribute,
- secondary_mail_addresses
+ list(set(secondary_mail_addresses))
)
- entry_modifications[secondary_mail_attribute] = secondary_mail_addresses
+ entry_modifications[secondary_mail_attribute] = list(set(secondary_mail_addresses))
log.debug(_("Entry modifications list: %r") % (entry_modifications), level=8)