Fix action plan state change when action failed

Since default workflow engine action container do_execute method
does not raise exception when action failed, workflow engine action
container execute method never raise exception and
action plan state becomes always SUCCEEDED.

This patch fixes default workflow engine action container do_execute
method to raise exception when action does not return True.

Change-Id: I7eeef69dbdfb5d40e3cf0b1004cbfe199a16bf7b
Closes-Bug: #1719793
This commit is contained in:
Hidekazu Nakamura
2017-09-27 16:37:35 +09:00
parent 773b20a05f
commit 5814914aef
4 changed files with 15 additions and 5 deletions

View File

@@ -127,8 +127,10 @@ class TaskFlowActionContainer(base.BaseTaskFlowActionContainer):
return self.engine.notify(self._db_action,
objects.action.State.SUCCEEDED)
else:
return self.engine.notify(self._db_action,
objects.action.State.FAILED)
self.engine.notify(self._db_action,
objects.action.State.FAILED)
raise exception.ActionExecutionFailure(
action_id=self._db_action.uuid)
def do_post_execute(self):
LOG.debug("Post-condition action: %s", self.name)