from ..config.ldap import LdapConfiguration, LdapConnectionInfo
from ..xlate import XLATOR, format_list
-__version__ = '0.11.9'
+__version__ = '0.12.0'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
ldap_group.add_argument('-I', '--instance', **arg_params)
+ if not self.use_multiple_ldap_connections:
+
+ ldap_group.add_argument(
+ '-b', '--base-dn', metavar='DN', dest='ldap_base_dn',
+ help=_(
+ 'Override the configured base DN of the instance used as the '
+ 'root for the LDAP searches.')
+ )
+
if self.show_cmdline_ldap_timeout:
ldap_group.add_argument(
'-T', '--timeout', metavar=_('SECONDS'), dest='ldap_timeout',
self._validate_given_instances(filtered_instances)
+ if not self.use_multiple_ldap_connections:
+ self._apply_target_cmdline_params(filtered_instances)
+
if self.verbose > 1:
LOG.debug(_('LDAP instances to use:') + ' ' + pp(self.ldap_instances))
if not all_ok:
self.exit(1)
+ # -------------------------------------------------------------------------
+ def _apply_target_cmdline_params(self, filtered_instances):
+
+ for inst in filtered_instances:
+
+ v = getattr(self.args, 'ldap_base_dn', None)
+ if v:
+ self.cfg.ldap_connection[inst].base_dn = v
+
# -------------------------------------------------------------------------
def _init_default_connection(self):