Merge "Conductor will properly log exceptions even if they are passed to failure blocks"

This commit is contained in:
Jenkins 2013-08-13 13:25:09 +00:00 committed by Gerrit Code Review
commit 23d31564db
2 changed files with 8 additions and 3 deletions

View File

@ -42,11 +42,13 @@ def update_cf_stack(engine, context, body, template, result=None, error=None,
}
failure_handler = body.find('failure')
if failure_handler is not None:
log.warning("Handling exception in failure block")
log.warning("Handling exception in failure block",
exc_info=True)
engine.evaluate_content(failure_handler, context)
return
else:
log.error("No failure block found for exception")
log.error("No failure block found for exception",
exc_info=True)
raise error_result
success_handler = body.find('success')

View File

@ -72,9 +72,12 @@ def send_command(engine, context, body, template, service, unit, mappings=None,
context[error] = errors
failure_handler = body.find('failure')
if failure_handler is not None:
log.warning(
"Handling errors ({0}) in failure block".format(errors),
exc_info=True)
engine.evaluate_content(failure_handler, context)
else:
log.error("No failure block found for exception")
log.error("No failure block found for errors", exc_info=True)
if isinstance(result_value, AgentTimeoutException):
raise result_value
else: