Fix method signature vif invocation

The vif rollback method used the wrong signature.  This fixes it.

Change-Id: I14a5298c74d71a91f218a0e1af676ec2af3359ba
Closes-Bug: #1636795
This commit is contained in:
Drew Thorstensen 2016-10-27 09:05:52 +02:00
parent af3aebdd8d
commit e11290cb01
2 changed files with 16 additions and 4 deletions

View File

@ -263,6 +263,18 @@ class TestVifFunctions(test.TestCase):
mock_drv.pre_live_migrate_at_source.assert_called_once_with(mock_vif)
@mock.patch('nova_powervm.virt.powervm.vif._build_vif_driver')
def test_rollback_live_migration_at_destination(self, mock_build_vif_drv):
mock_build_vif_drv.return_value = mock_drv = mock.MagicMock()
mock_vif, mappings = mock.MagicMock(), {}
vif.rollback_live_migration_at_destination(
self.adpt, 'host_uuid', mock.Mock(), mock_vif,
mappings)
rb = mock_drv.rollback_live_migration_at_destination
rb.assert_called_once_with(mock_vif, mappings)
@mock.patch('nova_powervm.virt.powervm.vif._build_vif_driver')
def test_pre_live_migrate_at_destination(self, mock_build_vif_drv):
mock_drv = mock.MagicMock()
@ -766,7 +778,7 @@ class TestVifOvsDriver(test.TestCase):
@mock.patch('pypowervm.wrappers.network.CNA.search')
@mock.patch('pypowervm.tasks.partition.get_this_partition')
@mock.patch('pypowervm.wrappers.network.VSwitch.search')
def test_rollback_live_migrate_at_destination(
def test_rollback_live_migration_at_destination(
self, mock_vs_search, mock_get_part, mock_cna_search):
# All the fun mocking
mock_vs_search.return_value = mock.MagicMock(switch_id=5)
@ -778,7 +790,7 @@ class TestVifOvsDriver(test.TestCase):
mock_cna_search.return_value = mock_trunk
# Invoke
self.drv.rollback_live_migrate_at_destination(vif, vea_vlan_mappings)
self.drv.rollback_live_migration_at_destination(vif, vea_vlan_mappings)
# Make sure the trunk was deleted
mock_trunk.delete.assert_called_once()

View File

@ -378,7 +378,7 @@ class PvmVifDriver(object):
"""
pass
def rollback_live_migrate_at_destination(self, vif, vea_vlan_mappings):
def rollback_live_migration_at_destination(self, vif, vea_vlan_mappings):
"""Rolls back the pre live migrate on the destination host.
:param vif: The virtual interface that was being migrated. This may be
@ -754,7 +754,7 @@ class PvmOvsVifDriver(PvmLioVifDriver):
{'mac': vif['address'], 'dev': dev, 'pvid': cna_w.pvid},
instance=self.instance)
def rollback_live_migrate_at_destination(self, vif, vea_vlan_mappings):
def rollback_live_migration_at_destination(self, vif, vea_vlan_mappings):
"""Rolls back the pre live migrate on the destination host.
Will delete the TrunkAdapter that pre_live_migrate_at_destination