Abort operation for live migration

This patch adds abort operation for live migration
to support abort in cancel action plan.

Change-Id: I458e93d9bd09dc4cf80cc941104129fc7600a6b1
Partially-Implements: blueprint cancel-action-plan
This commit is contained in:
aditi
2017-06-15 12:44:53 +00:00
committed by aditi sharma
parent 35fdbbe16e
commit 5283871af5
11 changed files with 141 additions and 13 deletions

View File

@@ -143,8 +143,14 @@ class TaskFlowActionContainer(base.BaseTaskFlowActionContainer):
def do_abort(self, *args, **kwargs):
LOG.warning("Aborting action: %s", self.name)
try:
self.action.abort()
self.engine.notify(self._db_action, objects.action.State.CANCELLED)
result = self.action.abort()
if result:
# Aborted the action.
self.engine.notify(self._db_action,
objects.action.State.CANCELLED)
else:
self.engine.notify(self._db_action,
objects.action.State.SUCCEEDED)
except Exception as e:
self.engine.notify(self._db_action, objects.action.State.FAILED)
LOG.exception(e)