Dennis Dmitriev | f3f90a5 | 2017-08-10 14:37:05 +0300 | [diff] [blame] | 1 | # Copyright 2017 Mirantis, Inc. |
| 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 | |
Tatyana Leontovich | c3d4714 | 2017-09-20 13:20:34 +0300 | [diff] [blame] | 15 | from tcp_tests.helpers import ext |
Dennis Dmitriev | f3f90a5 | 2017-08-10 14:37:05 +0300 | [diff] [blame] | 16 | from tcp_tests.managers.execute_commands import ExecuteCommandsMixin |
| 17 | |
| 18 | |
| 19 | class DecapodManager(ExecuteCommandsMixin): |
| 20 | """docstring for DecapodManager""" |
| 21 | |
| 22 | __config = None |
| 23 | __underlay = None |
| 24 | |
| 25 | def __init__(self, config, underlay, salt=None): |
| 26 | self.__config = config |
| 27 | self.__underlay = underlay |
| 28 | self._salt = salt |
| 29 | self.decapod_nodes = [ |
| 30 | i for i in self.__config.underlay.ssh |
| 31 | if any([ext.UNDERLAY_NODE_ROLES.decapod_mon in i['roles'], |
| 32 | ext.UNDERLAY_NODE_ROLES.decapod_osd in i['roles'], |
| 33 | ext.UNDERLAY_NODE_ROLES.decapod_all in i['roles']])] |
| 34 | super(DecapodManager, self).__init__( |
| 35 | config=config, underlay=underlay) |
| 36 | |
| 37 | def install(self, commands): |
| 38 | self.execute_commands(commands, |
| 39 | label='Deploy Ceph cluster with Decapod') |
| 40 | self.__config.decapod.decapod_installed = True |