Patrick East | 9b434d1 | 2016-08-12 17:23:19 -0700 | [diff] [blame] | 1 | # Copyright (c) 2016 Pure Storage, Inc. |
| 2 | # All Rights Reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 | # not use this file except in compliance with the License. You may obtain |
| 6 | # a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | # License for the specific language governing permissions and limitations |
| 14 | # under the License. |
| 15 | |
| 16 | from tempest import config |
| 17 | |
Chandan Kumar | 75511e3 | 2018-01-22 12:52:00 +0530 | [diff] [blame] | 18 | from cinder_tempest_plugin.services import consistencygroups_client |
| 19 | from cinder_tempest_plugin.services import volume_revert_client |
Patrick East | 9b434d1 | 2016-08-12 17:23:19 -0700 | [diff] [blame] | 20 | |
| 21 | CONF = config.CONF |
| 22 | |
| 23 | |
| 24 | class Manager(object): |
| 25 | def __init__(self, base_manager): |
| 26 | params = { |
| 27 | 'service': CONF.volume.catalog_type, |
| 28 | 'region': CONF.volume.region or CONF.identity.region, |
| 29 | 'endpoint_type': CONF.volume.endpoint_type, |
| 30 | 'build_interval': CONF.volume.build_interval, |
| 31 | 'build_timeout': CONF.volume.build_timeout |
| 32 | } |
| 33 | params.update(base_manager.default_params) |
| 34 | auth_provider = base_manager.auth_provider |
| 35 | |
| 36 | self.consistencygroups_adm_client = ( |
| 37 | consistencygroups_client.ConsistencyGroupsClient(auth_provider, |
| 38 | **params)) |
Eric Harney | b4e0dab | 2017-10-02 16:30:38 -0400 | [diff] [blame] | 39 | self.volume_revert_client = ( |
TommyLike | 589ca69 | 2017-05-10 10:13:23 +0800 | [diff] [blame] | 40 | volume_revert_client.VolumeRevertClient(auth_provider, **params)) |