Don't print colon if there's no exception message. Also, remove testing

exception.
This commit is contained in:
Zack Cerza 2013-08-29 14:56:15 -05:00
parent 83a5ab19b0
commit 40f1d4fc58

View File

@ -112,7 +112,10 @@ def set_up_logging(ctx):
def install_except_hook():
def log_exception(exception_class, exception, traceback):
logging.critical(''.join(format_tb(traceback)))
logging.critical('{0}: {1}'.format(exception_class, exception))
if not exception.message:
logging.critical(exception_class.__name__)
return
logging.critical('{0}: {1}'.format(exception_class.__name__, exception))
sys.excepthook = log_exception
@ -154,9 +157,6 @@ def main():
write_initial_metadata(ctx)
log.debug('test')
raise RuntimeError('hi there')
if 'targets' in ctx.config and 'roles' in ctx.config:
targets = len(ctx.config['targets'])
roles = len(ctx.config['roles'])