log-processor: include full exception traceback
This is currently failing in some cases (I'm sure it is when executor only jobs end up with things that aren't matched, but can't pinpoint exactly) but you only get "details": "IndexError('list index out of range',)", which doesn't help find out which list index was out of range. The get_execption() is for python 2.6 support (described [1]) so we can use the regular format. Then include the full traceback in the details so we can see the line causing problems. [1] https://docs.ansible.com/ansible/2.5/dev_guide/developing_python_3.html Change-Id: I20d1d99a48b7a173ab6c792dc3508c27b8047f6a
This commit is contained in:
parent
47a1c6e19b
commit
597135d528
@ -18,9 +18,10 @@
|
||||
import os
|
||||
import json
|
||||
import re
|
||||
import traceback
|
||||
|
||||
from ansible.module_utils.six.moves import urllib
|
||||
from ansible.module_utils.basic import AnsibleModule, get_exception
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
import gear
|
||||
|
||||
@ -199,9 +200,9 @@ def main():
|
||||
results['jobs'].append(handle)
|
||||
module.exit_json(**results)
|
||||
except Exception:
|
||||
e = get_exception()
|
||||
tb = traceback.format_exc()
|
||||
module.fail_json(msg='Unknown error',
|
||||
details=repr(e),
|
||||
details=tb,
|
||||
**results)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user