Commit a5e6845c by Brian Coca

Revert "Allow exceptions to pass through the program"

breaks handling constants.py errors gracefully

This reverts commit 59f96d71.
parent d1a6cfe6
...@@ -36,7 +36,6 @@ import os ...@@ -36,7 +36,6 @@ import os
import sys import sys
import traceback import traceback
import ansible.constants as C
from ansible.errors import AnsibleError, AnsibleOptionsError, AnsibleParserError from ansible.errors import AnsibleError, AnsibleOptionsError, AnsibleParserError
from ansible.utils.display import Display from ansible.utils.display import Display
...@@ -104,11 +103,8 @@ if __name__ == '__main__': ...@@ -104,11 +103,8 @@ if __name__ == '__main__':
except Exception as e: except Exception as e:
have_cli_options = cli is not None and cli.options is not None have_cli_options = cli is not None and cli.options is not None
display.error("Unexpected Exception: %s" % str(e), wrap_text=False) display.error("Unexpected Exception: %s" % str(e), wrap_text=False)
if not have_cli_options or have_cli_options and cli.options.verbosity > 2 or C.DEFAULT_DEBUG: if not have_cli_options or have_cli_options and cli.options.verbosity > 2:
display.display("the full traceback was:\n\n%s" % traceback.format_exc()) display.display("the full traceback was:\n\n%s" % traceback.format_exc())
else: else:
display.display("to see the full traceback, use -vvv") display.display("to see the full traceback, use -vvv")
if C.DEFAULT_DEBUG: sys.exit(250)
raise
else:
sys.exit(250)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment