Fix missing 'migration_completing' task state

For driver-assisted migration, 'migration_completing' task state
was not being set when accepting migration-complete requests.

APIImpact

Change-Id: Ie0ccd587232a4a8007c45d855f0f575a30b881b2
Closes-bug: #1638896
This commit is contained in:
Rodrigo Barbieri 2016-11-03 10:07:09 -02:00
parent ef91e54df4
commit 3f6fb58810
3 changed files with 17 additions and 3 deletions

View File

@ -996,6 +996,10 @@ class ShareManager(manager.SchedulerDependentManager):
dest_share_server = self._get_share_server(
context, dest_share_instance)
self.db.share_update(
context, share_ref['id'],
{'task_state': constants.TASK_STATE_MIGRATION_COMPLETING})
export_locations = self.driver.migration_complete(
context, src_share_instance, dest_share_instance,
share_server, dest_share_server)

View File

@ -4317,9 +4317,13 @@ class ShareManagerTestCase(test.TestCase):
self.share_manager.db.share_instance_update.assert_called_once_with(
self.context, dest_instance['id'],
{'status': constants.STATUS_AVAILABLE})
self.share_manager.db.share_update.assert_called_once_with(
self.context, dest_instance['share_id'],
{'task_state': constants.TASK_STATE_MIGRATION_SUCCESS})
self.share_manager.db.share_update.assert_has_calls([
mock.call(
self.context, dest_instance['share_id'],
{'task_state': constants.TASK_STATE_MIGRATION_COMPLETING}),
mock.call(
self.context, dest_instance['share_id'],
{'task_state': constants.TASK_STATE_MIGRATION_SUCCESS})])
def test__migration_complete_host_assisted(self):

View File

@ -0,0 +1,6 @@
---
fixes:
- Added missing 'migration_completing' task state when
requesting migration-complete for a driver-assisted share
migration.