Fixes message when variable cannot be used in a given state action.

When using a variable that is invalid for a given action, the `action`
was not being displayed in the error message, leading to a poor user
experience.
This commit is contained in:
Rafael Guterres Jeffman
2020-06-07 19:22:12 -03:00
parent a052160cc9
commit d7a3b7533c
+2 -2
View File
@@ -304,8 +304,8 @@ def check_parameters(module, state, action, names, parameters):
for _invalid in invalid:
if parameters[_invalid] is not None:
module.fail_json(
msg="Argument '%s' can not be used with state '%s'" %
(_invalid, state))
msg="Argument '%s' can not be used with state '%s', "
"action '%s'" % (_invalid, state, action))
def init_ansible_module():