Merge "Add set microversion in base compute service client"
diff --git a/tempest/services/compute/json/base.py b/tempest/services/compute/json/base.py
index 02e9f8b..ea1a696 100644
--- a/tempest/services/compute/json/base.py
+++ b/tempest/services/compute/json/base.py
@@ -12,10 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest.common import service_client
+from tempest_lib.common import rest_client
-class BaseComputeClient(service_client.ServiceClient):
+class BaseComputeClient(rest_client.RestClient):
api_microversion = None
def get_headers(self):
@@ -23,3 +23,6 @@
if self.api_microversion:
headers['X-OpenStack-Nova-API-Version'] = self.api_microversion
return headers
+
+ def set_api_microversion(self, microversion):
+ self.api_microversion = microversion
diff --git a/tempest/tests/services/compute/test_keypairs_client.py b/tempest/tests/services/compute/test_keypairs_client.py
index 8b1a9a8..03aee53 100644
--- a/tempest/tests/services/compute/test_keypairs_client.py
+++ b/tempest/tests/services/compute/test_keypairs_client.py
@@ -38,7 +38,7 @@
def _test_list_keypairs(self, bytes_body=False):
self.check_service_client_function(
self.client.list_keypairs,
- 'tempest.common.service_client.ServiceClient.get',
+ 'tempest_lib.common.rest_client.RestClient.get',
{"keypairs": []},
bytes_body)
@@ -60,7 +60,7 @@
self.check_service_client_function(
self.client.show_keypair,
- 'tempest.common.service_client.ServiceClient.get',
+ 'tempest_lib.common.rest_client.RestClient.get',
fake_keypair,
bytes_body,
keypair_name="test")
@@ -77,7 +77,7 @@
self.check_service_client_function(
self.client.create_keypair,
- 'tempest.common.service_client.ServiceClient.post',
+ 'tempest_lib.common.rest_client.RestClient.post',
fake_keypair,
bytes_body,
name="test")
@@ -91,5 +91,5 @@
def test_delete_keypair(self):
self.check_service_client_function(
self.client.delete_keypair,
- 'tempest.common.service_client.ServiceClient.delete',
+ 'tempest_lib.common.rest_client.RestClient.delete',
{}, status=202, keypair_name='test')