Don't track migrations in 'accepted' state
This state was added during Liberty for evacuate, and since it's the
first state that is assigned to the migration record on it's creation,
and before we start using it for resource tracking, there is no reason
to consider those records as "in progress".
Change-Id: I2a9bbe87bc1518cee9e43e4eeec1fa585305f423
Related-bug: 1417667
(cherry picked from commit 2c1f8e6002
)
This commit is contained in:
parent
7bc335535f
commit
fa3fb5e61f
|
@ -4482,8 +4482,8 @@ def migration_get_in_progress_by_host_and_node(context, host, node):
|
|||
models.Migration.source_node == node),
|
||||
and_(models.Migration.dest_compute == host,
|
||||
models.Migration.dest_node == node))).\
|
||||
filter(~models.Migration.status.in_(['confirmed', 'reverted',
|
||||
'error'])).\
|
||||
filter(~models.Migration.status.in_(['accepted', 'confirmed',
|
||||
'reverted', 'error'])).\
|
||||
options(joinedload_all('instance.system_metadata')).\
|
||||
all()
|
||||
|
||||
|
|
|
@ -1250,6 +1250,7 @@ class MigrationTestCase(test.TestCase):
|
|||
self._create(status='reverted')
|
||||
self._create(status='confirmed')
|
||||
self._create(status='error')
|
||||
self._create(status='accepted')
|
||||
self._create(source_compute='host2', source_node='b',
|
||||
dest_compute='host1', dest_node='a')
|
||||
self._create(source_compute='host2', dest_compute='host3')
|
||||
|
@ -1276,6 +1277,7 @@ class MigrationTestCase(test.TestCase):
|
|||
self.assertNotEqual('confirmed', migration['status'])
|
||||
self.assertNotEqual('reverted', migration['status'])
|
||||
self.assertNotEqual('error', migration['status'])
|
||||
self.assertNotEqual('accepted', migration['status'])
|
||||
|
||||
def test_migration_get_in_progress_joins(self):
|
||||
self._create(source_compute='foo', system_metadata={'foo': 'bar'})
|
||||
|
|
Loading…
Reference in New Issue