From df46ec72b944a8902194002d91935ee44aed8ad7 Mon Sep 17 00:00:00 2001 From: Dougal Matthews Date: Mon, 30 Jul 2018 12:11:11 +0100 Subject: [PATCH] Clarify what an exception from an action means When Python actions raise an exception they may not have failed to run. This may not even be an issue. For example, the OpenStack action `swift.head_container` will raise an exception is the container doesn't exist. This change lowers the exception to a warning but keeps the exception traceback in the logs. It also changes the wording in the message. We didn't fail to run the action, rather the action raise an exception. Change-Id: If9a6a3b98999acae8b80ad4ddeb9d197a628c280 --- mistral/executors/default_executor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mistral/executors/default_executor.py b/mistral/executors/default_executor.py index a2674fbad..661901abb 100644 --- a/mistral/executors/default_executor.py +++ b/mistral/executors/default_executor.py @@ -123,8 +123,8 @@ class DefaultExecutor(base.Executor): except BaseException as e: msg = ( - "Failed to run action [action_ex_id=%s, action_cls='%s', " - "attributes='%s', params='%s']\n %s" % ( + "The action raised an exception [action_ex_id=%s, " + "action_cls='%s', attributes='%s', params='%s']\n %s" % ( action_ex_id, action_cls, action_cls_attrs, @@ -133,7 +133,7 @@ class DefaultExecutor(base.Executor): ) ) - LOG.exception(msg) + LOG.warning(msg, exc_info=True) return send_error_back(msg)