We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1ad9e8 commit 9039a70Copy full SHA for 9039a70
1 file changed
library/commvault.py
@@ -199,7 +199,9 @@
199
'''
200
201
from ansible.module_utils.basic import AnsibleModule
202
+from ansible.module_utils._text import to_text
203
from cvpysdk.commcell import Commcell
204
+from cvpysdk.exception import SDKException
205
from cvpysdk.job import Job
206
207
@@ -331,9 +333,12 @@ def main():
331
333
else:
332
334
if module.params.get('args'):
335
statement = '{0} = list(module.params["args"].values())[0]'.format(statement)
- exec(statement)
- result['output'] = "Property set successfully"
336
- module.exit_json(**result)
+ try:
337
+ _ = exec(statement)
338
+ result['output'] = "Property set successfully"
339
+ module.exit_json(**result)
340
+ except SDKException as sdk_exception:
341
+ module.fail_json(to_text(sdk_exception))
342
343
output = eval(statement)
344
0 commit comments