from .ldap import BaseLdapApplication
from ..xlate import XLATOR
-__version__ = '0.9.3'
+__version__ = '0.9.4'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
return (oclasses, attributes)
+ # -------------------------------------------------------------------------
+ def remove_old_alias_entries(self):
+ """Remove all no more used alias entries."""
+ self.empty_line()
+ LOG.info(_('Removing all no more used alias entries …'))
+ inst = self.ldap_instances[0]
+
+ if not len(self.aliases_to_remove):
+ msg = _('No aliases found to remove in LDAP.')
+ LOG.info(msg)
+ if self.wait_interval:
+ time.sleep(self.wait_interval * 10)
+ return
+
+ for dn in self.aliases_to_remove:
+ self.delete_entry(inst, dn)
+ if self.wait_interval:
+ time.sleep(self.wait_interval)
+
# -------------------------------------------------------------------------
def add_failing_ldap_entries(self):
"""Create failing LDAP entries."""
LOG.info(_('Adding failing LDAP aliases ...'))
inst = self.ldap_instances[0]
+ if not len(self.aliases_to_create):
+ msg = _('No aliases found to create in LDAP.')
+ LOG.info(msg)
+ if self.wait_interval:
+ time.sleep(self.wait_interval * 10)
+ return
+
for cn in self.aliases_to_create:
dn = 'cn=' + cn + ',' + self.barracuda_base_dn
(oclasses, attributes) = self._create_ldap_entry_for_create(cn)
self.read_barracuda_ldap_aliases()
self.get_other_ldap_mail_entries()
self.eval_diffs()
+ self.remove_old_alias_entries()
self.add_failing_ldap_entries()