diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py index e54fa508c373..42d3c61be2f4 100644 --- a/nova/tests/unit/virt/libvirt/test_driver.py +++ b/nova/tests/unit/virt/libvirt/test_driver.py @@ -11771,10 +11771,13 @@ class LibvirtDriverTestCase(test.NoDBTestCase): def fake_plug_vifs(instance, network_info): pass - def fake_create_domain(xml, instance=None, launch_flags=0, - power_on=True): + def fake_create_domain(context, xml, instance, network_info, + disk_info, block_device_info=None, + power_on=None, + vifs_already_plugged=None): self.fake_create_domain_called = True self.assertEqual(powered_on, power_on) + self.assertTrue(vifs_already_plugged) return mock.MagicMock() def fake_enable_hairpin(instance): @@ -11796,7 +11799,7 @@ class LibvirtDriverTestCase(test.NoDBTestCase): self.stubs.Set(utils, 'execute', fake_execute) fw = base_firewall.NoopFirewallDriver() self.stubs.Set(self.drvr, 'firewall_driver', fw) - self.stubs.Set(self.drvr, '_create_domain', + self.stubs.Set(self.drvr, '_create_domain_and_network', fake_create_domain) self.stubs.Set(self.drvr, '_enable_hairpin', fake_enable_hairpin) diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 76544b348de7..538a739bc8fe 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -6492,7 +6492,8 @@ class LibvirtDriver(driver.ComputeDriver): self._create_domain_and_network(context, xml, instance, network_info, disk_info, block_device_info=block_device_info, - power_on=power_on) + power_on=power_on, + vifs_already_plugged=True) if power_on: timer = loopingcall.FixedIntervalLoopingCall(