role: Use IPAAnsibleModule method to validate arguments.

Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
This commit is contained in:
Rafael Guterres Jeffman
2021-09-30 21:18:17 -03:00
parent efa67303ac
commit 1ae2c1eb39

View File

@@ -151,11 +151,7 @@ def check_parameters(module):
if action != "member":
invalid.extend(['privilege'])
for arg in invalid:
if module.params_get(arg) is not None:
module.fail_json(
msg="Argument '%s' can not be used with action '%s'" %
(arg, state))
module.params_fail_used_invalid(invalid, state, action)
def member_intersect(module, attr, memberof, res_find):