mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Do not display traceback to user
Logging tracebacks at the INFO level caused them to be displayed to user on the command line. Change the log level to DEBUG, so that tracebacks are not visible to user. https://fedorahosted.org/freeipa/ticket/3704
This commit is contained in:
parent
e5117bd995
commit
2775dec3be
@ -618,14 +618,13 @@ def run_script(main_function, operation_name, log_file_name=None,
|
||||
root_logger.info('The %s command was successful',
|
||||
operation_name)
|
||||
else:
|
||||
# Log at the INFO level, which is not output to the console
|
||||
# Log at the DEBUG level, which is not output to the console
|
||||
# (unless in debug/verbose mode), but is written to a logfile
|
||||
# if one is open.
|
||||
tb = sys.exc_info()[2]
|
||||
root_logger.info('\n'.join(traceback.format_tb(tb)))
|
||||
root_logger.info('The %s command failed, exception: %s: %s',
|
||||
operation_name, type(e).__name__, e)
|
||||
exception = e
|
||||
root_logger.debug('\n'.join(traceback.format_tb(tb)))
|
||||
root_logger.debug('The %s command failed, exception: %s: %s',
|
||||
operation_name, type(e).__name__, e)
|
||||
if fail_message and not isinstance(e, SystemExit):
|
||||
print fail_message
|
||||
raise
|
||||
|
Loading…
Reference in New Issue
Block a user