Skip to content

Commit

Permalink
Fix fail_json
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hertel committed Apr 6, 2020
1 parent 73d1bbb commit 64efa41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/ansible/modules/net_tools/ldap/ldap_attr.py
Expand Up @@ -261,7 +261,7 @@ def main():
# However, the bind_pw parameter contains a password so it **must** go through the normal
# argument parsing even though removing it breaks backwards compat.
if 'bind_pw' in module.params['params']:
module.fail_json("Using `bind_pw` with the `params` option has been disallowed since"
module.fail_json(msg="Using `bind_pw` with the `params` option has been disallowed since"
" it is insecure. Use the `bind_pw` option directly. The `params`"
" option will be removed in Ansible-2.10")

Expand All @@ -272,7 +272,7 @@ def main():
else:
# For Ansible 2.10 and above
if module.params['params']:
module.fail_json("The `params` option to ldap_attr was removed in Ansible-2.10 since"
module.fail_json(msg="The `params` option to ldap_attr was removed in Ansible-2.10 since"
" it circumvents Ansible's option handling")

# Instantiate the LdapAttr object
Expand Down
4 changes: 2 additions & 2 deletions lib/ansible/modules/net_tools/ldap/ldap_entry.py
Expand Up @@ -214,7 +214,7 @@ def main():
# However, the bind_pw parameter contains a password so it **must** go through the normal
# argument parsing even though removing it breaks backwards compat.
if 'bind_pw' in module.params['params']:
module.fail_json("Using `bind_pw` with the `params` option has been disallowed since"
module.fail_json(msg="Using `bind_pw` with the `params` option has been disallowed since"
" it is insecure. Use the `bind_pw` option directly. The `params`"
" option will be removed in Ansible-2.10")

Expand All @@ -225,7 +225,7 @@ def main():
else:
# For Ansible 2.10 and above
if module.params['params']:
module.fail_json("The `params` option to ldap_attr was removed in Ansible-2.10 since"
module.fail_json(msg="The `params` option to ldap_attr was removed in Ansible-2.10 since"
" it circumvents Ansible's option handling")

state = module.params['state']
Expand Down

0 comments on commit 64efa41

Please sign in to comment.