# rom ..config.ldap import DEFAULT_PORT_LDAP, DEFAULT_PORT_LDAPS
from ..config.ldap import DEFAULT_TIMEOUT, MAX_TIMEOUT
-__version__ = '0.4.1'
+__version__ = '0.4.2'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
def disconnect_all(self):
if len(self.ldap_connection) or len(self.ldap_server):
- LOG.debug(_("Disconnecting all remaining LDAP instances ..."))
+ LOG.debug(_("Disconnecting from all remaining LDAP instances ..."))
for inst in self.ldap_instances:
self.disconnect_instance(inst)
if inst in self.ldap_connection:
ldap_connection = self.ldap_connection[inst]
- LOG.debug(_("Unbinding from LDAP server {!r} ...").format(connect_info.url))
+ if self.verbose > 1:
+ LOG.debug(_("Unbinding from LDAP server {!r} ...").format(connect_info.url))
ldap_connection.unbind()
ldap_connection = None
del self.ldap_connection[inst]
if inst in self.ldap_server:
- LOG.debug(_("Disconnecting from LDAP server {!r} ...").format(connect_info.url))
+ if self.verbose > 1:
+ LOG.debug(_("Disconnecting from LDAP server {!r} ...").format(connect_info.url))
del self.ldap_server[inst]
# -------------------------------------------------------------------------
from ..app.ldap import LdapAppError
from ..app.ldap import BaseLdapApplication
-__version__ = '0.3.1'
+__version__ = '0.3.2'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
if self.wrong_users:
self.exit(5)
- if self.verbose > 1:
- msg = _("Evaluated DNs of user {!r}:").format(user)
- LOG.debug(msg + ' ' + pp(self.dns))
+ if not self.dns:
+ msg = _("All given users were not found in any LDAP instance.")
+ LOG.warn(msg)
+ self.exit(1)
+
+ msg = _("Evaluated DNs to remove:")
+ LOG.debug(msg + '\n' + pp(self.dns))
# -------------------------------------------------------------------------
def eval_user_dns(self, user):