def _search(self, filterstr, attrlist=None):
"""
A wrapper for the `LDAPObject.search_s` functionality.
Perform an LDAP search operation, starting at the configured base DN.
The filterstr argument is a string representation of the filter to
apply in the search. The retrieved attributes can be limited with the
attrlist parameter. If attrlist is None, all the attributes of each
entry are returned.
"""
with self._ldap_connection() as ldap_cxn:
results = ldap_cxn.search_s(self.base_dn, ldap.SCOPE_ONELEVEL, filterstr, attrlist)
return results
评论列表
文章目录