Capture exception args for exceptions that have no msg or message,
and capture a traceback.
Signed-off-by: Dan Mick <dmick@redhat.com>
name={{ node_name }} operation=delete
"""
import ast
+import traceback
import xmltodict
HAS_JENKINS_API = True
else:
message = getattr(ex, 'message', None)
msg = getattr(ex, 'msg', message)
- msg = "%s: %s" % (ex.__class__.__name__, msg)
+ if not msg:
+ msg = str(ex)
+ msg = "%s: %s\n%s" % (ex.__class__.__name__, msg, traceback.format_tb(ex.__traceback__))
return module.fail_json(msg=msg)
args = {'changed': changed}