blob: 9c009badfd565d9681a383fc2f4b76eedede833a [file] [log] [blame]
Marc Kodererc832c612016-12-12 11:49:10 +01001# Copyright (c) 2016 SAP SE
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
dane-fichter5af45592017-02-08 17:29:53 -080015from tempest import clients
16from tempest.common import credentials_factory as common_creds
Marc Kodererc832c612016-12-12 11:49:10 +010017from tempest import config
dane-fichter5af45592017-02-08 17:29:53 -080018from tempest.lib.services import clients as cli
Marc Kodererc832c612016-12-12 11:49:10 +010019
20CONF = config.CONF
21
dane-fichter5af45592017-02-08 17:29:53 -080022ADMIN_CREDS = common_creds.get_configured_admin_credentials()
Marc Kodererc832c612016-12-12 11:49:10 +010023
dane-fichter5af45592017-02-08 17:29:53 -080024
25class Manager(clients.Manager):
26 def __init__(self, credentials=ADMIN_CREDS):
27 super(Manager, self).__init__(credentials)
28
29
30class Clients(cli.ServiceClients):
Marc Kodererc832c612016-12-12 11:49:10 +010031 """Tempest stable service clients and loaded plugins service clients"""
32
33 def __init__(self, credentials, service=None):
34 """Emulate the interface of Tempest's clients.Manager"""
35 # Identity settings
36 if CONF.identity.auth_version == 'v2':
37 identity_uri = CONF.identity.uri
38 else:
39 identity_uri = CONF.identity.uri_v3
40 super(Clients, self).__init__(credentials, identity_uri)