mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-22 10:21:25 -07:00
ldap_search: switch off client-chasing referrals (#1618)
* switch off client-chasing referrals * Add changelog fragment * Add comment to module * Sanity check * Update changelogs/fragments/1618-ldap_search-switch-off-cheasing-referrals.yaml Co-authored-by: Felix Fontein <felix@fontein.de> * Add module ref_chasing param to ldap module_utils * test acces token gitlab * test acces token gitlab: revert * Complete referrals_chasing parameter documentation * Fix parameter value check * Fix issue #963 * fix sanity check * Update plugins/doc_fragments/ldap.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update changelogs/fragments/1618-ldap_search-switch-off-cheasing-referrals.yaml Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/doc_fragments/ldap.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Mickael Foucher <mikael.foucher@groupama.com>
This commit is contained in:
parent
bb323ab12f
commit
cd022c3e2a
4 changed files with 27 additions and 4 deletions
|
@ -168,10 +168,14 @@ class LdapSearch(LdapGeneric):
|
|||
attrlist=self.attrlist,
|
||||
attrsonly=self.attrsonly
|
||||
)
|
||||
if self.schema:
|
||||
return [dict(dn=result[0], attrs=list(result[1].keys())) for result in results]
|
||||
else:
|
||||
return [_extract_entry(result[0], result[1]) for result in results]
|
||||
ldap_entries = []
|
||||
for result in results:
|
||||
if isinstance(result[1], dict):
|
||||
if self.schema:
|
||||
ldap_entries.append(dict(dn=result[0], attrs=list(result[1].keys())))
|
||||
else:
|
||||
ldap_entries.append(_extract_entry(result[0], result[1]))
|
||||
return ldap_entries
|
||||
except ldap.NO_SUCH_OBJECT:
|
||||
self.module.fail_json(msg="Base not found: {0}".format(self.dn))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue