Skip to content
Snippets Groups Projects
Commit aa864842 authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman
Browse files

templates: Use IPAAnsibleModule params_fail_used_invalid.

Modify new module templates to use IPAAnsibleModule method
`params_fail_used_invalid` to check for invalid parameter use for
a given state/action.
parent ee294259
No related branches found
No related tags found
No related merge requests found
......@@ -185,11 +185,7 @@ def main():
if action == "$name":
invalid.append("PARAMETER2")
for x in invalid:
if vars()[x] is not None:
ansible_module.fail_json(
msg="Argument '%s' can not be used with action "
"'%s' and state '%s'" % (x, action, state))
ansible_module.params_fail_used_invalid(invalid, state, action)
# Init
......
......@@ -151,11 +151,7 @@ def main():
ansible_module.fail_json(msg="No name given.")
invalid = ["PARAMETER1", "PARAMETER2"]
for x in invalid:
if vars()[x] is not None:
ansible_module.fail_json(
msg="Argument '%s' can not be used with state '%s'" %
(x, state))
ansible_module.params_fail_used_invalid(invalid, state)
# Init
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment