Skip to content
Snippets Groups Projects
Commit bc0f211c authored by Thomas Woerner's avatar Thomas Woerner
Browse files

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.
parent 6e2fa7e7
No related branches found
No related tags found
No related merge requests found
...@@ -122,12 +122,9 @@ def api_connect(): ...@@ -122,12 +122,9 @@ def api_connect():
def api_command(module, command, name, args): 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)
return api.Command[command](name, **args)
except Exception as e:
module.fail_json(msg="%s: %s" % (command, e))
def execute_api_command(module, principal, password, command, name, args): def execute_api_command(module, principal, password, command, name, args):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment