Don't revert Migrate action

If Migrate action succeed, don't revert instance when the actionplan failed.

Change-Id: Ic1c1151a3152e632ad90c6f006e8c7d5abded223
Closes-Bug: #1839909
This commit is contained in:
licanwei
2019-08-13 14:09:59 +08:00
parent d55bb1fa95
commit c522e881b1
2 changed files with 1 additions and 24 deletions

View File

@@ -186,7 +186,7 @@ class Migrate(base.BaseAction):
return self.migrate(destination=self.destination_node) return self.migrate(destination=self.destination_node)
def revert(self): def revert(self):
return self.migrate(destination=self.source_node) LOG.info('Migrate action do not revert!')
def abort(self): def abort(self):
nova = nova_helper.NovaHelper(osc=self.osc) nova = nova_helper.NovaHelper(osc=self.osc)

View File

@@ -187,29 +187,6 @@ class TestMigration(base.TestCase):
dest_hostname="compute2-hostname" dest_hostname="compute2-hostname"
) )
def test_revert_live_migration(self):
self.m_helper.find_instance.return_value = self.INSTANCE_UUID
self.action.revert()
self.m_helper_cls.assert_called_once_with(osc=self.m_osc)
self.m_helper.live_migrate_instance.assert_called_once_with(
instance_id=self.INSTANCE_UUID,
dest_hostname="compute1-hostname"
)
def test_revert_cold_migration(self):
self.m_helper.find_instance.return_value = self.INSTANCE_UUID
self.action_cold.revert()
self.m_helper_cls.assert_called_once_with(osc=self.m_osc)
self.m_helper.watcher_non_live_migrate_instance.\
assert_called_once_with(
instance_id=self.INSTANCE_UUID,
dest_hostname="compute1-hostname"
)
def test_abort_live_migrate(self): def test_abort_live_migrate(self):
migration = mock.MagicMock() migration = mock.MagicMock()
migration.id = "2" migration.id = "2"