from ..config.ldap import LdapConfiguration, LdapConnectionInfo
from ..xlate import XLATOR, format_list
-__version__ = '0.12.0'
+__version__ = '0.12.1'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
if not self.use_multiple_ldap_connections:
+ ldap_group.add_argument(
+ '-H', '--ldap-host', metavar=_('HOST'), dest='ldap_host',
+ help=_(
+ 'Override configured hostname or address of the LDAP server.')
+ )
+
+ ldap_group.add_argument(
+ '-p', '--ldap-port', metavar=_('PORT'), type=int, dest='ldap_port',
+ action=LdapPortOptionAction,
+ help=_('Override the configured port number to connect to the LDAP server.')
+ )
+
ldap_group.add_argument(
'-b', '--base-dn', metavar='DN', dest='ldap_base_dn',
help=_(
for inst in filtered_instances:
+ v = getattr(self.args, 'ldap_host', None)
+ if v:
+ self.cfg.ldap_connection[inst].host = v
+
+ v = getattr(self.args, 'ldap_port', None)
+ if v is not None:
+ self.cfg.ldap_connection[inst].port = v
+
v = getattr(self.args, 'ldap_base_dn', None)
if v:
self.cfg.ldap_connection[inst].base_dn = v
+ v = getattr(self.args, 'ldap_bind_dn', None)
+ if v:
+ self.cfg.ldap_connection[inst].bind_dn = v
+
+ v = getattr(self.args, 'ldap_bind_pw', None)
+ if v:
+ self.cfg.ldap_connection[inst].bind_pw = v
+
# -------------------------------------------------------------------------
def _init_default_connection(self):