ansible_freeipa_module: New function api_check_command

This function can be used to check if a command is available in the API.

This is used in ipauser module to check if user_add_certmapdata is available
in the API.
This commit is contained in:
Thomas Woerner
2020-05-06 16:37:18 +02:00
parent 6a69bbeafb
commit fdcdad2c7e

View File

@@ -175,6 +175,11 @@ def api_command_no_name(module, command, args):
return api.Command[command](**args)
def api_check_command(command):
"""Return if command exists in command list."""
return command in api.Command
def api_check_param(command, name):
"""Check if param exists in command param list."""
return name in api.Command[command].params