Skip to content

Commit

Permalink
ipaconfig: Fix fail_json calls.
Browse files Browse the repository at this point in the history
Ansible's fail_json() method required that the message paramater was
passed with a keyword parameter, rather than a positional one. Although
this seems to work with ansible-core 2.13+, it might not work with
previous versions of Ansible.

This patch fixes the behaviour for all supported Ansible versions.
  • Loading branch information
rjeffman committed Sep 21, 2022
1 parent 433d109 commit eaf1dcd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugins/modules/ipaconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,13 +482,14 @@ def main():
required_sid = any([netbios_name, add_sids])
if required_sid and not enable_sid:
ansible_module.fail_json(
"'enable-sid: yes' required for 'netbios_name' "
"and 'add-sids'."
msg="'enable-sid: yes' required for 'netbios_name' "
"and 'add-sids'."
)
if enable_sid:
if not has_enable_sid:
ansible_module.fail_json(
"This version of IPA does not support 'enable-sid'.")
ansible_module.fail_json(msg=(
"This version of IPA does not support 'enable-sid'."
))
if (
netbios_name
and netbios_name == get_netbios_name(ansible_module)
Expand Down

0 comments on commit eaf1dcd

Please sign in to comment.