blob: 146fbdd1692b3e6ab744ab305190975483925e6c [file] [log] [blame]
Dennis Dmitriev8cb2f412016-10-18 14:53:58 +03001# Copyright 2016 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.
14import copy
15import os
16
17import yaml
18
19from devops.helpers import helpers
20
21from tcp_tests.helpers import exceptions
22from tcp_tests import logger
23from tcp_tests import settings
24
25LOG = logger.logger
26
27
28class TCPManager(object):
29 """docstring for TCPManager"""
30
31 __config = None
32 __underlay = None
33
34 def __init__(self, config, underlay):
35 self.__config = config
36 self.__underlay = underlay
37 self._api_client = None
38
39 if self.__config.tcp.tcp_host == '0.0.0.0':
40 # Temporary workaround. Underlay should be extended with roles
41 tcp_nodes = self.__underlay.node_names()
42 self.__config.tcp.tcp_host = \
43 self.__underlay.host_by_node_name(tcp_nodes[0])
44
45 super(TCPManager, self).__init__()
46
47 def show_tcp_config(self):
48 cmd = 'reclass -n {0}'.format(self.__underlay.node_names()[0])
Dennis Dmitriev75fce1b2016-10-18 15:04:28 +030049 self.__underlay.sudo_check_call(cmd, host=self.__config.tcp.tcp_host,
50 verbose=True)
Dennis Dmitriev8cb2f412016-10-18 14:53:58 +030051
52 def install_tcp(self):
53 raise Exception("Not implemented!")