dnsrecord: 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:13:57 -03:00
parent 67282b1a6a
commit 6f7b514e02

View File

@@ -1201,11 +1201,7 @@ def check_parameters(module, state, zone_name, record):
invalid = list(_PART_MAP.keys())
invalid.extend(['create_reverse', 'dns_ttl'])
for x in invalid:
if x in record:
module.fail_json(
msg="Variable `%s` cannot be used in state `%s`" %
(x, state))
module.params_fail_used_invalid(invalid, state)
def get_entry_from_module(module, name):