mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-08 06:13:21 +00:00
ansible_freeipa_module: api_command should not have extra try clause
api_command is always used within try clause, therefore it is not needed to have an extra try clause within api_command. Additionally it is needed to get the dofferent errors in the next level.
This commit is contained in:
@@ -122,12 +122,9 @@ def api_connect():
|
||||
|
||||
def api_command(module, command, name, args):
|
||||
"""
|
||||
Call ipa.Command, use AnsibleModule.fail_json for error handling
|
||||
Call ipa.Command
|
||||
"""
|
||||
try:
|
||||
return api.Command[command](name, **args)
|
||||
except Exception as e:
|
||||
module.fail_json(msg="%s: %s" % (command, e))
|
||||
return api.Command[command](name, **args)
|
||||
|
||||
|
||||
def execute_api_command(module, principal, password, command, name, args):
|
||||
|
||||
Reference in New Issue
Block a user