Make BaseInfraOptimClient as base client for both watcher and gnocchi

This patch set moves BaseInfraOptimClient to services folder and
represents it as base class for both clients.

Change-Id: I94e35dbb34d38f7a669788dab5f6a21a592ac4e8
This commit is contained in:
Alexander Chadin 2018-03-26 11:53:40 +03:00
parent b5642ee2d4
commit 9efb0866ae
3 changed files with 9 additions and 9 deletions

View File

@ -44,19 +44,19 @@ def handle_errors(f):
@six.add_metaclass(abc.ABCMeta)
class BaseInfraOptimClient(rest_client.RestClient):
"""Base Tempest REST client for Watcher API."""
class BaseClient(rest_client.RestClient):
"""Base Tempest REST client for API."""
URI_PREFIX = ''
@abc.abstractmethod
def serialize(self, object_dict):
"""Serialize an Watcher object."""
"""Serialize an object."""
raise NotImplementedError()
@abc.abstractmethod
def deserialize(self, object_str):
"""Deserialize an Watcher object."""
"""Deserialize an object."""
raise NotImplementedError()
def _get_uri(self, resource_name, uuid=None, permanent=False):
@ -186,7 +186,7 @@ class BaseInfraOptimClient(rest_client.RestClient):
@handle_errors
def get_api_description(self):
"""Retrieves all versions of the Watcher API."""
"""Retrieves all versions of the API."""
return self._list_request('', permanent=True)

View File

@ -16,10 +16,10 @@
from oslo_serialization import jsonutils
from oslo_utils import uuidutils
from watcher_tempest_plugin.services.infra_optim import base
from watcher_tempest_plugin.services import base
class InfraOptimClientJSON(base.BaseInfraOptimClient):
class InfraOptimClientJSON(base.BaseClient):
"""Base Tempest REST client for Watcher API v1."""
URI_PREFIX = 'v1'

View File

@ -16,10 +16,10 @@
from oslo_serialization import jsonutils
from watcher_tempest_plugin.services.infra_optim import base
from watcher_tempest_plugin.services import base
class GnocchiClientJSON(base.BaseInfraOptimClient):
class GnocchiClientJSON(base.BaseClient):
"""Base Tempest REST client for Gnocchi API v1."""
URI_PREFIX = 'v1'