mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-08-05 14:24:48 +00:00
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:
@@ -175,6 +175,11 @@ def api_command_no_name(module, command, args):
|
|||||||
return api.Command[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):
|
def api_check_param(command, name):
|
||||||
"""Check if param exists in command param list."""
|
"""Check if param exists in command param list."""
|
||||||
return name in api.Command[command].params
|
return name in api.Command[command].params
|
||||||
|
|||||||
Reference in New Issue
Block a user