1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Allow LDAP search to run in check mode (#3667)

* Allow ldap search to run in check mode always

* Fix indentions

* Remove Comments and Chg Fragment

* Update changelogs/fragments/3667-ldap_search.yml

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

Co-authored-by: Sebastian Trupiano <sebastian.trupiano@srpnet.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
sabman3 2021-11-13 07:00:05 -07:00 committed by GitHub
parent 4fe5d54b9e
commit 115d435d2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- ldap_search - allow it to be used even in check mode (https://github.com/ansible-collections/community.general/issues/3619).

View file

@ -106,11 +106,10 @@ def main():
module.fail_json(msg=missing_required_lib('python-ldap'), module.fail_json(msg=missing_required_lib('python-ldap'),
exception=LDAP_IMP_ERR) exception=LDAP_IMP_ERR)
if not module.check_mode: try:
try: LdapSearch(module).main()
LdapSearch(module).main() except Exception as exception:
except Exception as exception: module.fail_json(msg="Attribute action failed.", details=to_native(exception))
module.fail_json(msg="Attribute action failed.", details=to_native(exception))
module.exit_json(changed=False) module.exit_json(changed=False)