# 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
        self.sahara = clients.SaharaClient(session=session,
                                           service_type=sahara_service_type,
                                           sahara_url=sahara_url,
                                           api_version=api_version)
        self.nova = clients.NovaClient(session=session)
        self.neutron = clients.NeutronClient(session=session)
        # swiftclient doesn't support keystone sessions
        self.swift = clients.SwiftClient(
            auth_version=auth_version,
            authurl=auth_url,
            user=username,
            key=password,
            insecure=not self.credentials.get('ssl_verify', False),
            cacert=self.credentials.get('ssl_cert'),
            tenant_name=tenant_name)
        self.glance = clients.GlanceClient(session=session)
        # boto is not an OpenStack client, but we can handle it as well
        self.boto = None
        if self.credentials.get("s3_endpoint", None):
            self.boto = clients.BotoClient(
                endpoint=self.credentials["s3_endpoint"],
                accesskey=self.credentials["s3_accesskey"],
                secretkey=self.credentials["s3_secretkey"])

    def create_cluster(self):
        self.cluster_id = self.sahara.get_cluster_id(
            self.testcase.get('existing_cluster'))
        self.ng_id_map = {}
        if self.cluster_id is None:
            self.ng_id_map = self._create_node_group_templates()

# 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

        self.sahara = clients.SaharaClient(session=session,
                                           service_type=sahara_service_type,
                                           sahara_url=sahara_url,
                                           api_version=api_version)
        self.nova = clients.NovaClient(session=session)
        self.neutron = clients.NeutronClient(session=session)
        # swiftclient doesn't support keystone sessions
        self.swift = clients.SwiftClient(
            auth_version=auth_version,
            authurl=auth_url,
            user=username,
            key=password,
            insecure=not self.credentials.get('ssl_verify', False),
            cacert=self.credentials.get('ssl_cert'),
            tenant_name=tenant_name)
        self.glance = clients.GlanceClient(session=session)
        # boto is not an OpenStack client, but we can handle it as well
        self.boto = None
        if self.credentials.get("s3_endpoint", None):
            self.boto = clients.BotoClient(
                endpoint=self.credentials["s3_endpoint"],
                accesskey=self.credentials["s3_accesskey"],
                secretkey=self.credentials["s3_secretkey"])

    def create_cluster(self):
        self.cluster_id = self.sahara.get_cluster_id(
            self.testcase.get('existing_cluster'))
        self.ng_id_map = {}
        if self.cluster_id is None:
            self.ng_id_map = self._create_node_group_templates()

            cl_tmpl_id = self._create_cluster_template()