# Standard module
import logging
import copy
+import re
# Third party modules
from .xlate import XLATOR
-__version__ = '0.2.1'
+__version__ = '0.2.2'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
@property
def use_ldaps(self):
"""Should there be used LDAPS for communicating with the LDAP server?"""
- return self.use_ldaps
+ return self._use_ldaps
@use_ldaps.setter
def use_ldaps(self, value):
- self.use_ldaps = to_bool(value)
+ self._use_ldaps = to_bool(value)
# -----------------------------------------------------------
@property
def port(self):
"The TCP port number of the LDAP server."
- return self._api_port
+ return self._port
@port.setter
def port(self, value):
new = self.__class__()
for key in self.keys():
- new[key] = copy.copy(self.[key])
+ new[key] = copy.copy(self[key])
return new
msg = _("Value {!r} for a timeout is invalid:").format(value)
msg += ' ' + str(e)
LOG.error(msg)
- continue
+ return
if timeout <= 0 or timeout > MAX_TIMEOUT:
msg = _("Value {!r} for a timeout is invalid:").format(value)
msg += ' ' + str(e)
LOG.error(msg)
- continue
+ return
self.ldap_timeout = timeout
value = section[key]
- if self.re_ldap_host_key.match(key)
+ if self.re_ldap_host_key.match(key):
if value.strip():
connection.host = value
else: