From e4fb870ab73b87387db0a9d59857277be1fc459f Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Fri, 2 Nov 2018 17:23:16 -0400 Subject: [PATCH] Update compute API.get() stubs in test_access_ips These old tests were stubbing the DB API to get an instance which is too low-level. This changes the stub to be on the compute API.get() method. This is part of a larger series to drop pre-cellsv2 compat code in compute API.get(). Change-Id: I6a8629bf06492a4b57f8951fdb8c61db9681adde --- nova/tests/unit/api/openstack/compute/test_access_ips.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nova/tests/unit/api/openstack/compute/test_access_ips.py b/nova/tests/unit/api/openstack/compute/test_access_ips.py index 936bb8cbf2a8..376f47ccaa6b 100644 --- a/nova/tests/unit/api/openstack/compute/test_access_ips.py +++ b/nova/tests/unit/api/openstack/compute/test_access_ips.py @@ -38,8 +38,9 @@ class AccessIPsAPIValidationTestV21(test.TestCase): fakes.stub_out_nw_api(self) self._set_up_controller() fake.stub_out_image_service(self) - self.stub_out('nova.db.api.instance_get_by_uuid', - fakes.fake_instance_get()) + self.stub_out('nova.compute.api.API.get', + # This project_id matches fakes.HTTPRequest.blank. + fakes.fake_compute_get(project_id='fake')) self.stub_out('nova.objects.instance.Instance.save', fake_save) self.stub_out('nova.compute.api.API.rebuild', fake_rebuild)