Beispiel #1
0
    def __init__(self):
        super(KollaCli, self).__init__(
            description=u._('Command-Line Client for OpenStack Kolla'),
            version=VERSION,
            command_manager=CommandManager('kolla.cli'),
        )

        inventory_path = os.path.join(get_kolla_cli_etc(), INVENTORY_PATH)
        if not self._is_inventory_present(inventory_path):
            err_string = u._(
                'Required file ({inventory}) does not exist.\n'
                'Please re-install the kollacli to '
                'recreate the file.').format(inventory=inventory_path)
            raise CommandError(err_string)

        # set up logging and test that user running shell is part
        # of kolla group
        ClientApi()

        # paramiko log is very chatty, tune it down
        logging.getLogger('paramiko').setLevel(logging.WARNING)

        self.dump_stack_trace = False
Beispiel #2
0
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import os
import shutil
import sys
import tarfile
import tempfile
import traceback

from kolla_cli.api.client import ClientApi

tar_file_descr = None

CLIENT = ClientApi()

LOGDIR = '/tmp/container_logs'


def get_logs_from_host(host):
    try:
        service_names = []
        services = CLIENT.service_get_all()
        for service in services:
            service_names.append(service.name)

        print('Adding container logs from host: %s' % host)
        CLIENT.support_get_logs(service_names, host, LOGDIR)
    except Exception as e:
        print('Error getting logs on host: %s: %s' % (host, str(e)))
Beispiel #3
0
import logging
import os
import shutil
import subprocess
import sys
import testtools

import kolla_cli.common.utils as utils

from copy import copy
from shutil import copyfile

from kolla_cli.api.client import ClientApi
from kolla_cli.api.exceptions import InvalidArgument

CLIENT = ClientApi()
CLIENT.enable_console_logging(logging.DEBUG)

ARG_LIST = {
    bool: False,
    list: [1, 2, 3],
    str: 'qwerty',
    dict: {'a': 1},
    int: 0,
    }

TEST_SUFFIX = 'test/'
VENV_PY_PATH = '.venv/bin/python'
KOLLA_CMD = 'kolla-cli'
KOLLA_SHELL_DIR = 'kolla_cli'