Cancelled live migration are not in progress

Since we have introduced the new API for aborting a running live
migration we have introduced a new state called "cancelled" which is
applied to all the aborted live migration job in the libvirt driver.
This new status is not filtered by the sqlalchemy query used to get the
list of the all migration in progress for host and node.

Change-Id: I219591297f73c4bb8b1d97aaf298681c0421d1ae
Closes-bug: #1588378
This commit is contained in:
Andrea Rosa 2016-06-02 16:27:15 +01:00
parent 580975a2f8
commit f7af7486ce

@ -4857,7 +4857,8 @@ def migration_get_in_progress_by_host_and_node(context, host, node):
models.Migration.dest_node == node))).\
filter(~models.Migration.status.in_(['accepted', 'confirmed',
'reverted', 'error',
'failed', 'completed'])).\
'failed', 'completed',
'cancelled'])).\
options(joinedload_all('instance.system_metadata')).\
all()