Skip to content

Commit

Permalink
Use tempest's ServiceClients rather than Manager
Browse files Browse the repository at this point in the history
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: I870f3662679dddf8f29328b10c7fd9637dad9436
  • Loading branch information
kopecmartin committed Dec 21, 2020
1 parent f165a64 commit dd96e9a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions neutron_tempest_plugin/api/clients.py
Expand Up @@ -13,22 +13,23 @@
# License for the specific language governing permissions and limitations
# under the License.

from tempest import clients as tempest_clients
from tempest.lib.services import clients
from tempest.lib.services.compute import availability_zone_client
from tempest.lib.services.compute import hypervisor_client
from tempest.lib.services.compute import interfaces_client
from tempest.lib.services.compute import keypairs_client
from tempest.lib.services.compute import servers_client
from tempest.lib.services.identity.v2 import tenants_client
from tempest.lib.services.identity.v3 import projects_client
from tempest import manager

from neutron_tempest_plugin import config
from neutron_tempest_plugin.services.network.json import network_client

CONF = config.CONF


class Manager(manager.Manager):
class Manager(clients.ServiceClients):
"""Top level manager for OpenStack tempest clients"""
default_params = {
'disable_ssl_certificate_validation':
Expand All @@ -47,7 +48,15 @@ class Manager(manager.Manager):
default_params_with_timeout_values.update(default_params)

def __init__(self, credentials=None, service=None):
super(Manager, self).__init__(credentials=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)

self._set_identity_clients()

Expand Down

0 comments on commit dd96e9a

Please sign in to comment.