summaryrefslogtreecommitdiffstats
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:23:34 +0000
commit837bf4fe7a6d2b33feae8bf463c866b936766892 (patch)
treee78d8bd2a9f8c83a66a95f215bb0e8be5f67c433
parent5038a508e6af07f1bf7a55f95e877d84cf8568c9 (diff)
downloadpykolab-837bf4fe7a6d2b33feae8bf463c866b936766892.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)
-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 e15ff60..75c11d5 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -768,16 +768,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 secondary_mail_addresses == 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)