Use tempest's ServiceClients rather than Manager

tempest.Manager has been deprecated for more than 4 years already
and will be removed by [1].
Tempest plugins are expected to consume
tempest.lib.services.clients.ServiceClients directly.

[1] https://review.opendev.org/c/openstack/tempest/+/767628

Change-Id: I72b6984e9da724339702cddfa62e140593196508
This commit is contained in:
Martin Kopec 2020-12-18 13:21:08 +00:00
parent ef43ff4459
commit e9a808ee89
1 changed files with 12 additions and 3 deletions

View File

@ -14,12 +14,13 @@
# under the License.
from oslo_serialization import jsonutils as json
from tempest import clients as tempest_clients
from tempest import config
from tempest.lib.common import rest_client
from tempest.lib.services import clients
from tempest.lib.services.image.v2 import images_client as image_cli
from tempest.lib.services.network import floating_ips_client as fip_cli
from tempest.lib.services.network import networks_client as network_cli
from tempest import manager
CONF = config.CONF
@ -353,7 +354,7 @@ class BaremetalNodeClient(rest_client.RestClient):
self.update_bm_node(node_id, updates)
class Manager(manager.Manager):
class Manager(clients.ServiceClients):
load_clients = [
'baremetal_compute_client',
@ -403,7 +404,15 @@ class Manager(manager.Manager):
baremetal_node_params.update(default_params)
def __init__(self, credentials=None, service=None):
super(Manager, self).__init__(credentials)
dscv = CONF.identity.disable_ssl_certificate_validation
_, uri = tempest_clients.get_auth_provider_class(credentials)
super(Manager, self).__init__(
credentials=credentials,
identity_uri=uri,
scope='project',
disable_ssl_certificate_validation=dscv,
ca_certs=CONF.identity.ca_certificates_file,
trace_requests=CONF.debug.trace_requests)
for client in self.load_clients:
getattr(self, 'set_%s' % client)()