diff --git a/nova/tests/unit/api/openstack/compute/test_hosts.py b/nova/tests/unit/api/openstack/compute/test_hosts.py index 902a473cd8c6..308202e8b1d9 100644 --- a/nova/tests/unit/api/openstack/compute/test_hosts.py +++ b/nova/tests/unit/api/openstack/compute/test_hosts.py @@ -378,7 +378,7 @@ class HostTestCaseV21(test.TestCase): s_ref = self._create_compute_service() with mock.patch.object(self.controller.api, 'instance_get_all_by_host') as m: - m.side_effect = exception.HostMappingNotFound + m.side_effect = exception.HostMappingNotFound(name='something') self.assertRaises(webob.exc.HTTPNotFound, self.controller.show, self.req, s_ref['host']) diff --git a/nova/tests/unit/api/openstack/compute/test_hypervisors.py b/nova/tests/unit/api/openstack/compute/test_hypervisors.py index 04304cd49e43..29e7303d12d5 100644 --- a/nova/tests/unit/api/openstack/compute/test_hypervisors.py +++ b/nova/tests/unit/api/openstack/compute/test_hypervisors.py @@ -639,7 +639,7 @@ class HypervisorsTestV21(test.NoDBTestCase): req = self._get_request(True) with mock.patch.object(self.controller.host_api, 'instance_get_all_by_host') as m: - m.side_effect = exception.HostMappingNotFound + m.side_effect = exception.HostMappingNotFound(name='something') self.assertRaises(exc.HTTPNotFound, self.controller.servers, req, 'hyper') diff --git a/nova/tests/unit/api/openstack/compute/test_services.py b/nova/tests/unit/api/openstack/compute/test_services.py index 0be82436a5c6..41ea739f1c25 100644 --- a/nova/tests/unit/api/openstack/compute/test_services.py +++ b/nova/tests/unit/api/openstack/compute/test_services.py @@ -494,7 +494,7 @@ class ServicesTestV21(test.TestCase): body = {'host': 'invalid', 'binary': 'nova-compute'} with mock.patch.object(self.controller.host_api, 'service_update') as m: - m.side_effect = exception.HostMappingNotFound + m.side_effect = exception.HostMappingNotFound(name='something') self.assertRaises(webob.exc.HTTPNotFound, self.controller.update, self.req, diff --git a/nova/tests/unit/compute/test_compute.py b/nova/tests/unit/compute/test_compute.py index e0eed5d061ed..e95f38d4eff8 100644 --- a/nova/tests/unit/compute/test_compute.py +++ b/nova/tests/unit/compute/test_compute.py @@ -1302,7 +1302,7 @@ class ComputeVolumeTestCase(BaseTestCase): self.instance_object, 'fake_id', 'fake_id2', {}) @mock.patch.object(cinder.API, 'create', - side_effect=exception.OverQuota()) + side_effect=exception.OverQuota(overs='something')) def test_prep_block_device_over_quota_failure(self, mock_create): instance = self._create_fake_instance_obj() bdms = [ diff --git a/nova/tests/unit/compute/test_compute_mgr.py b/nova/tests/unit/compute/test_compute_mgr.py index c0e9f27a53ce..47b30891e35d 100644 --- a/nova/tests/unit/compute/test_compute_mgr.py +++ b/nova/tests/unit/compute/test_compute_mgr.py @@ -4151,7 +4151,8 @@ class ComputeManagerBuildInstanceTestCase(test.NoDBTestCase): def test_build_and_run_volume_encryption_not_supported(self): self._test_build_and_run_spawn_exceptions( - exception.VolumeEncryptionNotSupported(reason="")) + exception.VolumeEncryptionNotSupported(volume_type='something', + volume_id='something')) def test_build_and_run_invalid_input(self): self._test_build_and_run_spawn_exceptions( diff --git a/nova/tests/unit/conductor/test_conductor.py b/nova/tests/unit/conductor/test_conductor.py index 6716a7997420..cc550934fad8 100644 --- a/nova/tests/unit/conductor/test_conductor.py +++ b/nova/tests/unit/conductor/test_conductor.py @@ -2442,7 +2442,7 @@ class ConductorTaskRPCAPITestCase(_BaseTaskTestCase, def test(self, context, instance): return mock.sentinel.iransofaraway - mock_im.side_effect = exc.InstanceMappingNotFound + mock_im.side_effect = exc.InstanceMappingNotFound(uuid='something') ctxt = mock.MagicMock() inst = mock.MagicMock() self.assertEqual(mock.sentinel.iransofaraway, diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py index 2e7df3d66da0..5dffc856850e 100644 --- a/nova/tests/unit/virt/libvirt/test_driver.py +++ b/nova/tests/unit/virt/libvirt/test_driver.py @@ -5959,10 +5959,11 @@ class LibvirtConnTestCase(test.NoDBTestCase): drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False) self.assertTrue(drvr.instance_exists(None)) - mock_get_guest.side_effect = exception.InstanceNotFound + mock_get_guest.side_effect = exception.InstanceNotFound( + instance_id='something') self.assertFalse(drvr.instance_exists(None)) - mock_get_guest.side_effect = exception.InternalError + mock_get_guest.side_effect = exception.InternalError(err='something') self.assertFalse(drvr.instance_exists(None)) def test_estimate_instance_overhead_spawn(self): diff --git a/nova/tests/unit/virt/powervm/test_driver.py b/nova/tests/unit/virt/powervm/test_driver.py index f8f9b44990fb..258eab1ecf7f 100644 --- a/nova/tests/unit/virt/powervm/test_driver.py +++ b/nova/tests/unit/virt/powervm/test_driver.py @@ -120,7 +120,8 @@ class TestPowerVMDriver(test.NoDBTestCase): mock_del.reset_mock() # InstanceNotFound exception, non-forced - mock_pwroff.side_effect = exception.InstanceNotFound + mock_pwroff.side_effect = exception.InstanceNotFound( + instance_id='something') self.drv.destroy('context', self.inst, [], block_device_info={}, destroy_disks=False) mock_pwroff.assert_called_once_with(