<commit_before>#! /usr/bin/env python
# flake8: NOQA

import sys
import os

from cosmo_tester.framework.util import YamlPatcher

shared_provider_properties = {
    'RESOURCE_PREFIX'       : 'cloudify.resources_prefix',
    'COMPONENTS_PACKAGE_URL': 'cloudify.server.packages.components_package_url',
    'CORE_PACKAGE_URL'      : 'cloudify.server.packages.core_package_url',
    'UI_PACKAGE_URL'        : 'cloudify.server.packages.ui_package_url',
    'UBUNTU_PACKAGE_URL'    : 'cloudify.agents.packages.ubuntu_agent_url',
    'CENTOS_PACKAGE_URL'    : 'cloudify.agents.packages.centos_agent_url',
    'WINDOWS_PACKAGE_URL'   : 'cloudify.agents.packages.windows_agent_url',
    'WORKFLOW_TASK_RETRIES' : 'cloudify.workflows.task_retries',
}

ec2_provider_properties = {
    'AWS_ACCESS_ID'         : 'connection.access_id',
    'AWS_SECRET_KEY'        : 'connection.secret_key',
}

openstack_provider_properties = {
    'KEYSTONE_PASSWORD'     : '<PASSWORD>',
    'KEYSTONE_USERNAME'     : 'keystone.username',
    'KEYSTONE_TENANT'       : 'keystone.tenant_name',
    'KEYSTONE_AUTH_URL'     : 'keystone.auth_url',
}

shared_inputs_properties = {
    'RESOURCE_PREFIX'       : 'resources_prefix'
}

openstack_inputs_properties = {
    'KEYSTONE_USERNAME'     : 'keystone_username',
    'KEYSTONE_PASSWORD'     : '<PASSWORD>',
    'KEYSTONE_TENANT'       : 'keystone_tenant_name',
    'KEYSTONE_AUTH_URL'     : 'keystone_url'
}

shared_manager_blueprint_properties = {
    'COMPONENTS_PACKAGE_URL':
        'node_templates.manager.properties.cloudify_packages.server'
        '.components_package_url',
    'CORE_PACKAGE_URL'      :
        'node_templates.manager.properties.cloudify_packages.server'
        '.core_package_url',
    'UI_PACKAGE_URL'        :
        'node_templates.manager.properties.cloudify_packages.server'
        '.ui_package_url',
    'UBUNTU_PACKAGE_URL'    :
        'node_templates.manager.properties.cloudify_packages.agents'
        '.ubuntu_agent_url',
    'CENTOS_PACKAGE_URL'    :
        'node_templates.manager.properties.cloudify_packages.agents.'
        'centos_agent_url',
    'WINDOWS_PACKAGE_URL'   :
        'node_templates.manager.properties.cloudify_packages.agents'
        '.windows_agent_url',
    'WORKFLOW_TASK_RETRIES' :
        'node_templates.manager.properties.cloudify.workflows.task_retries',
}

docker_manager_blueprint_properties = {
    'DOCKER_IMAGE_URL':
        'node_templates.manager.properties.cloudify_packages.docker'
        '.docker_url',
    'DOCKER_DATA_URL':
        'node_templates.manager.properties.cloudify_packages.docker'
        '.docker_data_url',
}

def main():
    config_path = sys.argv[1]
    bootstrap_using_providers = \
        os.environ['BOOTSTRAP_USING_PROVIDERS'] == 'true'
    bootstrap_using_docker = \
        os.environ['BOOTSTRAP_USING_DOCKER'] == 'true'

    handler = os.environ.get('CLOUDIFY_TEST_HANDLER_MODULE')
    if handler in [
        'cosmo_tester.framework.handlers.openstack',
        'cosmo_tester.framework.handlers.simple_on_openstack']:
        cloud_specific_properties = openstack_provider_properties \
            if bootstrap_using_providers else openstack_inputs_properties
    elif handler == 'cosmo_tester.framework.handlers.openstack_nova_net':
        # openstack_nova_net handler currently has no cloud specific
        # properties, as the credentials information is simply hardcoded in its
        # inputs file, and there's no need to override it with quickbuild
        # data. if such a need arises, there should be separate env vars
        # for the nova net openstack credentials.
        cloud_specific_properties = {}
    elif handler == 'cosmo_tester.framework.handlers.ec2':
        cloud_specific_properties = ec2_provider_properties
    else:<commit_msg>CFY-1308 fixed default value error<commit_after>#! /usr/bin/env python
# flake8: NOQA

import sys
import os

from cosmo_tester.framework.util import YamlPatcher

shared_provider_properties = {
    'RESOURCE_PREFIX'       : 'cloudify.resources_prefix',
    'COMPONENTS_PACKAGE_URL': 'cloudify.server.packages.components_package_url',
    'CORE_PACKAGE_URL'      : 'cloudify.server.packages.core_package_url',
    'UI_PACKAGE_URL'        : 'cloudify.server.packages.ui_package_url',
    'UBUNTU_PACKAGE_URL'    : 'cloudify.agents.packages.ubuntu_agent_url',
    'CENTOS_PACKAGE_URL'    : 'cloudify.agents.packages.centos_agent_url',
    'WINDOWS_PACKAGE_URL'   : 'cloudify.agents.packages.windows_agent_url',
    'WORKFLOW_TASK_RETRIES' : 'cloudify.workflows.task_retries',
}

ec2_provider_properties = {
    'AWS_ACCESS_ID'         : 'connection.access_id',
    'AWS_SECRET_KEY'        : 'connection.secret_key',
}

openstack_provider_properties = {
    'KEYSTONE_PASSWORD'     : '<PASSWORD>',
    'KEYSTONE_USERNAME'     : 'keystone.username',
    'KEYSTONE_TENANT'       : 'keystone.tenant_name',
    'KEYSTONE_AUTH_URL'     : 'keystone.auth_url',
}

shared_inputs_properties = {
    'RESOURCE_PREFIX'       : 'resources_prefix'
}

openstack_inputs_properties = {
    'KEYSTONE_USERNAME'     : 'keystone_username',
    'KEYSTONE_PASSWORD'     : '<PASSWORD>',
    'KEYSTONE_TENANT'       : 'keystone_tenant_name',
    'KEYSTONE_AUTH_URL'     : 'keystone_url'
}

shared_manager_blueprint_properties = {
    'COMPONENTS_PACKAGE_URL':
        'node_templates.manager.properties.cloudify_packages.server'
        '.components_package_url',
    'CORE_PACKAGE_URL'      :
        'node_templates.manager.properties.cloudify_packages.server'
        '.core_package_url',
    'UI_PACKAGE_URL'        :
        'node_templates.manager.properties.cloudify_packages.server'
        '.ui_package_url',
    'UBUNTU_PACKAGE_URL'    :
        'node_templates.manager.properties.cloudify_packages.agents'
        '.ubuntu_agent_url',
    'CENTOS_PACKAGE_URL'    :
        'node_templates.manager.properties.cloudify_packages.agents.'
        'centos_agent_url',
    'WINDOWS_PACKAGE_URL'   :
        'node_templates.manager.properties.cloudify_packages.agents'
        '.windows_agent_url',
    'WORKFLOW_TASK_RETRIES' :
        'node_templates.manager.properties.cloudify.workflows.task_retries',
}

docker_manager_blueprint_properties = {
    'DOCKER_IMAGE_URL':
        'node_templates.manager.properties.cloudify_packages.docker'
        '.docker_url',
    'DOCKER_DATA_URL':
        'node_templates.manager.properties.cloudify_packages.docker'
        '.docker_data_url',
}

def main():
    config_path = sys.argv[1]
    bootstrap_using_providers = \
        os.environ['BOOTSTRAP_USING_PROVIDERS'] == 'true'
    bootstrap_using_docker = \
        os.environ.get('BOOTSTRAP_USING_DOCKER', 'false') == 'true'

    handler = os.environ.get('CLOUDIFY_TEST_HANDLER_MODULE')
    if handler in [
        'cosmo_tester.framework.handlers.openstack',
        'cosmo_tester.framework.handlers.simple_on_openstack']:
        cloud_specific_properties = openstack_provider_properties \
            if bootstrap_using_providers else openstack_inputs_properties
    elif handler == 'cosmo_tester.framework.handlers.openstack_nova_net':
        # openstack_nova_net handler currently has no cloud specific
        # properties, as the credentials information is simply hardcoded in its
        # inputs file, and there's no need to override it with quickbuild
        # data. if such a need arises, there should be separate env vars
        # for the nova net openstack credentials.
        cloud_specific_properties = {}
    elif handler == 'cosmo_tester.framework.handlers.ec2':
        cloud_specific_properties = ec2_provider_properties
    else:
{'fraction_non_alphanumeric': 0.09887079831932773, 'fraction_numerical': 0.001838235294117647, 'mean_word_length': 3.5720288115246097, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1533321', 'n_tokens_mistral': 2538, 'n_tokens_neox': 2483, 'n_words': 330}