# Path: sahara_tests/scenario/timeouts.py
# class Defaults(object):
#     def __init__(self, config):
#     def init_defaults(cls, config):
# 
# Path: sahara_tests/scenario/utils.py
# SCENARIO_RESOURCES_DIR = pkg.resource_filename(version.version_info.package,
#                                                'scenario')
# TEST_TEMPLATE_DIR = os.path.join(SCENARIO_RESOURCES_DIR, 'defaults/')
# DEFAULT_TEMPLATE_VARS = [os.path.join(TEST_TEMPLATE_DIR,
#                                       'credentials.yaml.mako'),
#                          os.path.join(TEST_TEMPLATE_DIR,
#                                       'edp.yaml.mako')]
# TEST_TEMPLATE_PATH = os.path.join(SCENARIO_RESOURCES_DIR,
#                                   'testcase.py.mako')
# DEFAULT_STESTR_CONF = os.path.join(SCENARIO_RESOURCES_DIR, 'stestr.conf')
# def rand_name(name=''):
# def run_tests(concurrency, test_dir_path):
# def create_testcase_file(testcases, credentials, network, report,
#                          use_api_v2=False):
# def get_templates_variables(files, variable_file, verbose_run, scenario_args,
#                             auth_values):
# def generate_config(files, template_variables, auth_values, verbose_run,
#                     features_list=None):
# def get_default_templates(plugin, version, release, scenario_arguments,
#                           features=None):
# def get_auth_values(cloud_config, args):
# def _merge_dicts_sections(dict_with_section, dict_for_merge, section):
# def is_template_file(config_file):
# def read_template_variables(variable_file=None, verbose=False,
#                             scenario_args=None, auth_values=None):
# def read_scenario_config(scenario_config, template_vars=None,
#                          verbose=False):
# 
# Path: sahara_tests/utils/url.py
# def url_schema_remover(url):


import functools
import logging
import os
import sys
import time
import traceback
import fixtures
import prettytable
import six
from oslo_utils import timeutils
from tempest.lib import base
from tempest.lib.common import ssh as connection
from tempest.lib import exceptions as exc
from sahara_tests.scenario import clients
from sahara_tests.scenario import timeouts
from sahara_tests.scenario import utils
from sahara_tests.utils import crypto as ssh
from sahara_tests.utils import url as utils_url
        if self.proxy:
            host_ip = self.proxy
            command = ("echo '{pkey}' > {filename} && chmod 600 {filename} && "
                       "ssh -o StrictHostKeyChecking=no {ip} -i {filename} "
                       "'{cmd}' && rm {filename}".format(
                           pkey=self.private_key, filename='scenario.pem',
                           ip=node_ip, cmd=command))
        ssh_session = connection.Client(host_ip, self.testcase['ssh_username'],
                                        pkey=self.private_key)
        return ssh_session.exec_command(command)

    def _get_nodes_with_process(self, process=None):
        if process is not None:
            process = process.lower()
        nodegroups = self.sahara.get_cluster(self.cluster_id).node_groups
        nodes_with_process = []
        for nodegroup in nodegroups:
            for node_process in nodegroup['node_processes']:
                if not process or process in node_process.lower():
                    nodes_with_process.extend(nodegroup['instances'])
        return nodes_with_process

    def _get_health_status(self, cluster):
        try:
            return cluster.verification['status']
        except (AttributeError, KeyError):
            return 'UNKNOWN'

    def _poll_verification_status(self, cluster_id):
        with fixtures.Timeout(

# Path: sahara_tests/scenario/timeouts.py
# class Defaults(object):
#     def __init__(self, config):
#     def init_defaults(cls, config):
# 
# Path: sahara_tests/scenario/utils.py
# SCENARIO_RESOURCES_DIR = pkg.resource_filename(version.version_info.package,
#                                                'scenario')
# TEST_TEMPLATE_DIR = os.path.join(SCENARIO_RESOURCES_DIR, 'defaults/')
# DEFAULT_TEMPLATE_VARS = [os.path.join(TEST_TEMPLATE_DIR,
#                                       'credentials.yaml.mako'),
#                          os.path.join(TEST_TEMPLATE_DIR,
#                                       'edp.yaml.mako')]
# TEST_TEMPLATE_PATH = os.path.join(SCENARIO_RESOURCES_DIR,
#                                   'testcase.py.mako')
# DEFAULT_STESTR_CONF = os.path.join(SCENARIO_RESOURCES_DIR, 'stestr.conf')
# def rand_name(name=''):
# def run_tests(concurrency, test_dir_path):
# def create_testcase_file(testcases, credentials, network, report,
#                          use_api_v2=False):
# def get_templates_variables(files, variable_file, verbose_run, scenario_args,
#                             auth_values):
# def generate_config(files, template_variables, auth_values, verbose_run,
#                     features_list=None):
# def get_default_templates(plugin, version, release, scenario_arguments,
#                           features=None):
# def get_auth_values(cloud_config, args):
# def _merge_dicts_sections(dict_with_section, dict_for_merge, section):
# def is_template_file(config_file):
# def read_template_variables(variable_file=None, verbose=False,
#                             scenario_args=None, auth_values=None):
# def read_scenario_config(scenario_config, template_vars=None,
#                          verbose=False):
# 
# Path: sahara_tests/utils/url.py
# def url_schema_remover(url):


# Path: sahara_tests/scenario/base.py
import functools
import logging
import os
import sys
import time
import traceback
import fixtures
import prettytable
import six
from oslo_utils import timeutils
from tempest.lib import base
from tempest.lib.common import ssh as connection
from tempest.lib import exceptions as exc
from sahara_tests.scenario import clients
from sahara_tests.scenario import timeouts
from sahara_tests.scenario import utils
from sahara_tests.utils import crypto as ssh
from sahara_tests.utils import url as utils_url

        if self.proxy:
            host_ip = self.proxy
            command = ("echo '{pkey}' > {filename} && chmod 600 {filename} && "
                       "ssh -o StrictHostKeyChecking=no {ip} -i {filename} "
                       "'{cmd}' && rm {filename}".format(
                           pkey=self.private_key, filename='scenario.pem',
                           ip=node_ip, cmd=command))
        ssh_session = connection.Client(host_ip, self.testcase['ssh_username'],
                                        pkey=self.private_key)
        return ssh_session.exec_command(command)

    def _get_nodes_with_process(self, process=None):
        if process is not None:
            process = process.lower()
        nodegroups = self.sahara.get_cluster(self.cluster_id).node_groups
        nodes_with_process = []
        for nodegroup in nodegroups:
            for node_process in nodegroup['node_processes']:
                if not process or process in node_process.lower():
                    nodes_with_process.extend(nodegroup['instances'])
        return nodes_with_process

    def _get_health_status(self, cluster):
        try:
            return cluster.verification['status']
        except (AttributeError, KeyError):
            return 'UNKNOWN'

    def _poll_verification_status(self, cluster_id):
        with fixtures.Timeout(

                timeouts.Defaults.instance.timeout_poll_cluster_status,