diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 73e3f82930c1..3e6dc8094fe0 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -9399,8 +9399,8 @@ class ComputeManager(manager.Manager): # We don't generate events if CONF.vif_plugging_timeout=0 # meaning that the operator disabled using them. if CONF.vif_plugging_timeout: - return (instance.get_network_info() - .get_live_migration_plug_time_events()) + return [('network-vif-plugged', vif['id']) + for vif in instance.get_network_info()] else: return [] diff --git a/nova/network/model.py b/nova/network/model.py index c59161daaf9e..a7d5849a1a5d 100644 --- a/nova/network/model.py +++ b/nova/network/model.py @@ -489,14 +489,6 @@ class VIF(Model): 'ips': ips} return [] - @property - def has_live_migration_plug_time_event(self): - """Returns whether this VIF's network-vif-plugged external event will - be sent by Neutron at "plugtime" - in other words, as soon as neutron - completes configuring the network backend. - """ - return self.is_hybrid_plug_enabled() - def is_hybrid_plug_enabled(self): return self['details'].get(VIF_DETAILS_OVS_HYBRID_PLUG, False) @@ -557,13 +549,6 @@ class NetworkInfo(list): def json(self): return jsonutils.dumps(self) - def get_live_migration_plug_time_events(self): - """Returns a list of external events for any VIFs that have - "plug-time" events during live migration. - """ - return [('network-vif-plugged', vif['id']) - for vif in self if vif.has_live_migration_plug_time_event] - def has_port_with_allocation(self): return any(vif.has_allocation() for vif in self) diff --git a/nova/tests/unit/compute/test_compute_mgr.py b/nova/tests/unit/compute/test_compute_mgr.py index 43b359e2f544..b300ee3a58c0 100644 --- a/nova/tests/unit/compute/test_compute_mgr.py +++ b/nova/tests/unit/compute/test_compute_mgr.py @@ -11914,17 +11914,6 @@ class ComputeManagerMigrationTestCase(test.NoDBTestCase, [], self.compute._get_neutron_events_for_live_migration( self.instance)) - # 3. no plug time events - with mock.patch.object(self.instance, 'get_network_info') as nw_info: - nw_info.return_value = network_model.NetworkInfo( - [network_model.VIF( - uuids.port1, details={ - network_model.VIF_DETAILS_OVS_HYBRID_PLUG: False})]) - self.assertFalse(nw_info.return_value[0].is_hybrid_plug_enabled()) - self.assertEqual( - [], self.compute._get_neutron_events_for_live_migration( - self.instance)) - @mock.patch('nova.compute.rpcapi.ComputeAPI.pre_live_migration') @mock.patch('nova.compute.manager.ComputeManager._post_live_migration') @mock.patch('nova.objects.BlockDeviceMappingList.get_by_instance_uuid')