from ..errors import DpxWriteLdapItemError
from ..xlate import XLATOR, format_list
-__version__ = '1.3.5'
+__version__ = '1.3.6'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
uri=connect_info.url, bdn=base_dn, fltr=ldap_filter)
LOG.debug(msg)
- if inst not in self.ldap_connection:
- self.connect_instance(inst)
- ldap = self.ldap_connection[inst]
-
- try:
- req_status, req_result, req_response, req_whatever = ldap.search(
- search_base=base_dn, search_scope=SUBTREE, search_filter=ldap_filter,
- get_operational_attributes=False, attributes=attributes,
- time_limit=self.cfg.ldap_timeout)
- finally:
- if not self.single_session:
- self.disconnect_instance(inst)
+ (search_status, search_result, search_response) = self.search(
+ inst=inst, search_base=base_dn, attributes=attributes, scope=SUBTREE)
- if req_status:
- for entry in req_response:
+ if search_status:
+ for entry in search_response:
if self.verbose > 4:
LOG.debug(_('Got a response entry:') + ' ' + pp(entry))
result.append(entry['dn'])
uri=connect_info.url, bdn=base_dn, fltr=ldap_filter)
LOG.debug(msg)
- if inst not in self.ldap_connection:
- self.connect_instance(inst)
- ldap = self.ldap_connection[inst]
-
- try:
- req_status, req_result, req_response, req_whatever = ldap.search(
- search_base=base_dn, search_scope=SUBTREE, search_filter=ldap_filter,
- get_operational_attributes=False, attributes=attributes,
- time_limit=self.cfg.ldap_timeout)
- finally:
- if not self.single_session:
- self.disconnect_instance(inst)
+ (search_status, search_result, search_response) = self.search(
+ inst=inst, search_base=base_dn, attributes=attributes, scope=SUBTREE)
- if req_status:
- for entry in req_response:
+ if search_status:
+ for entry in search_response:
if self.verbose > 4:
LOG.debug(_('Got a response entry:') + ' ' + pp(entry))
result.append(entry['dn'])
uri=connect_info.url, bdn=base_dn, fltr=ldap_filter)
LOG.debug(msg)
- if inst not in self.ldap_connection:
- self.connect_instance(inst)
- ldap = self.ldap_connection[inst]
-
- try:
- req_status, req_result, req_response, req_whatever = ldap.search(
- search_base=base_dn, search_scope=SUBTREE, search_filter=ldap_filter,
- get_operational_attributes=False, attributes=attributes,
- time_limit=self.cfg.ldap_timeout)
- finally:
- if not self.single_session:
- self.disconnect_instance(inst)
+ (search_status, search_result, search_response) = self.search(
+ inst=inst, search_base=base_dn, attributes=attributes, scope=SUBTREE)
- if req_status:
- for entry in req_response:
+ if search_status:
+ for entry in search_response:
if self.verbose > 4:
LOG.debug(_('Got a response entry:') + ' ' + pp(entry))
result.append(entry['dn'])
uri=connect_info.url, bdn=base_dn, fltr=ldap_filter)
LOG.debug(msg)
- if inst not in self.ldap_connection:
- self.connect_instance(inst)
- ldap = self.ldap_connection[inst]
-
- try:
- req_status, req_result, req_response, req_whatever = ldap.search(
- search_base=base_dn, search_scope=SUBTREE, search_filter=ldap_filter,
- get_operational_attributes=False, attributes=attributes,
- time_limit=self.cfg.ldap_timeout)
- finally:
- if not self.single_session:
- self.disconnect_instance(inst)
+ (search_status, search_result, search_response) = self.search(
+ inst=inst, search_base=base_dn, attributes=attributes, scope=SUBTREE)
- if req_status:
- for entry in req_response:
+ if search_status:
+ for entry in search_response:
if self.verbose > 4:
LOG.debug(_('Got a response entry:') + ' ' + pp(entry))
result.append(entry['dn'])