blob: c491c7759d6a976986eb5227ce981c7a25fe583e [file] [log] [blame]
Yuiko Takadab6527002015-12-07 11:49:12 +09001# All Rights Reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of 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
13# under the License.
14
15from tempest import clients
16from tempest.common import credentials_factory as common_creds
17from tempest import config
18
19from ironic_tempest_plugin.services.baremetal.v1.json.baremetal_client import \
20 BaremetalClient
21
22
23CONF = config.CONF
24
Emilien Macchi8ec45422016-05-29 21:56:23 -040025ADMIN_CREDS = common_creds.get_configured_admin_credentials()
Yuiko Takadab6527002015-12-07 11:49:12 +090026
27
28class Manager(clients.Manager):
29 def __init__(self,
Vladyslav Drok96bd3e32017-01-05 12:19:11 +020030 credentials=ADMIN_CREDS):
Yuiko Takadaff785002015-12-17 15:56:42 +090031 """Initialization of Manager class.
32
33 Setup service client and make it available for test cases.
34 :param credentials: type Credentials or TestResources
Yuiko Takadaff785002015-12-17 15:56:42 +090035 """
Vladyslav Drok96bd3e32017-01-05 12:19:11 +020036 super(Manager, self).__init__(credentials)
Thiago Paivaa7760932016-08-15 15:23:30 -030037 default_params_with_timeout_values = {
38 'build_interval': CONF.compute.build_interval,
39 'build_timeout': CONF.compute.build_timeout
40 }
41 default_params_with_timeout_values.update(self.default_params)
42
Yuiko Takadab6527002015-12-07 11:49:12 +090043 self.baremetal_client = BaremetalClient(
44 self.auth_provider,
45 CONF.baremetal.catalog_type,
46 CONF.identity.region,
47 endpoint_type=CONF.baremetal.endpoint_type,
Thiago Paivaa7760932016-08-15 15:23:30 -030048 **default_params_with_timeout_values)