aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-05-31 13:59:32 +0000
committerGerrit Code Review <review@openstack.org>2016-05-31 13:59:33 +0000
commitca6cf5bfd1cf23c63705caf93b70514f8d30b550 (patch)
tree1c871d133b32debcf9acdb313e7d20651d38ab98 /ansible
parent430e79b35b2a8f2a0aa78d8a577cb4cea76464ba (diff)
parent476da0f43acda64f660427cc0457b1fffaf4c0b7 (diff)
downloadkolla-ca6cf5bfd1cf23c63705caf93b70514f8d30b550.tar.gz
kolla-ca6cf5bfd1cf23c63705caf93b70514f8d30b550.zip
Merge "Log the traceback in the kolla libraries"
Diffstat (limited to 'ansible')
-rw-r--r--ansible/library/bslurp.py6
-rw-r--r--ansible/library/kolla_docker.py6
2 files changed, 8 insertions, 4 deletions
diff --git a/ansible/library/bslurp.py b/ansible/library/bslurp.py
index a4479c244..b342da3f4 100644
--- a/ansible/library/bslurp.py
+++ b/ansible/library/bslurp.py
@@ -109,6 +109,7 @@ Distribute a to file many host without compression; Change permissions on dest:
import base64
import hashlib
import os
+import traceback
import zlib
@@ -180,8 +181,9 @@ def main():
copy_to_host(module)
else:
copy_from_host(module)
- except Exception as e:
- module.exit_json(failed=True, changed=True, msg=repr(e))
+ except Exception:
+ module.exit_json(failed=True, changed=True,
+ msg=repr(traceback.format_exc()))
# import module snippets
diff --git a/ansible/library/kolla_docker.py b/ansible/library/kolla_docker.py
index 4930ad490..7c60deb5d 100644
--- a/ansible/library/kolla_docker.py
+++ b/ansible/library/kolla_docker.py
@@ -188,6 +188,7 @@ EXAMPLES = '''
'''
import os
+import traceback
import docker
@@ -728,8 +729,9 @@ def main():
# meaningful data, we need to refactor all methods to return dicts.
result = bool(getattr(dw, module.params.get('action'))())
module.exit_json(changed=dw.changed, result=result)
- except Exception as e:
- module.exit_json(failed=True, changed=True, msg=repr(e))
+ except Exception:
+ module.exit_json(failed=True, changed=True,
+ msg=repr(traceback.format_exc()))
# import module snippets
from ansible.module_utils.basic import * # noqa