# Path: sahara_tests/version.py



import argparse
import collections
import os
import shutil
import subprocess
import sys
import tempfile
import os_client_config
import pkg_resources as pkg
import six
import yaml
from mako import template as mako_template
from oslo_utils import fileutils
from oslo_utils import uuidutils
from sahara_tests.scenario import validation
from sahara_tests import version

        # return a combination of: default templates, version-specific
        # templates, feature-based templates
        all_templates = DEFAULT_TEMPLATE_VARS + [os.path.join(
            templates_location, template)] + feature_templates_vars

    # it makes sense that all the other templates passed as arguments
    # are always added at the end
    all_templates += scenario_arguments
    return all_templates


def get_auth_values(cloud_config, args):
    try:
        cloud = cloud_config.get_one_cloud(argparse=args)
        cloud_credentials = cloud.get_auth_args()
        api_version = cloud.config.get('identity_api_version')
    except os_client_config.exceptions.OpenStackConfigException:
        # cloud not found
        api_version = '2.0'
        cloud_credentials = {}
    auth_values = {
        'os_username': cloud_credentials.get('username', 'admin'),
        'os_password': cloud_credentials.get('password', 'nova'),
        'os_auth_url': cloud_credentials.get('auth_url',
                                             'http://localhost:5000/v2.0'),
        'os_tenant': cloud_credentials.get('project_name', 'admin')
    }
    auth_url = auth_values['os_auth_url']
    if not any(v in auth_url for v in ('v2.0', 'v3')):

# Path: sahara_tests/version.py



# Path: sahara_tests/scenario/utils.py
import argparse
import collections
import os
import shutil
import subprocess
import sys
import tempfile
import os_client_config
import pkg_resources as pkg
import six
import yaml
from mako import template as mako_template
from oslo_utils import fileutils
from oslo_utils import uuidutils
from sahara_tests.scenario import validation
from sahara_tests import version


        # return a combination of: default templates, version-specific
        # templates, feature-based templates
        all_templates = DEFAULT_TEMPLATE_VARS + [os.path.join(
            templates_location, template)] + feature_templates_vars

    # it makes sense that all the other templates passed as arguments
    # are always added at the end
    all_templates += scenario_arguments
    return all_templates


def get_auth_values(cloud_config, args):
    try:
        cloud = cloud_config.get_one_cloud(argparse=args)
        cloud_credentials = cloud.get_auth_args()
        api_version = cloud.config.get('identity_api_version')
    except os_client_config.exceptions.OpenStackConfigException:
        # cloud not found
        api_version = '2.0'
        cloud_credentials = {}
    auth_values = {
        'os_username': cloud_credentials.get('username', 'admin'),
        'os_password': cloud_credentials.get('password', 'nova'),
        'os_auth_url': cloud_credentials.get('auth_url',
                                             'http://localhost:5000/v2.0'),
        'os_tenant': cloud_credentials.get('project_name', 'admin')
    }
    auth_url = auth_values['os_auth_url']
    if not any(v in auth_url for v in ('v2.0', 'v3')):

        version = 'v3' if api_version in ('3', '3.0') else 'v2.0'