예제 #1
0
파일: steps.py 프로젝트: Fiware/cloud.PaaS
def endpoints_from_service_catalog(step):
    """ Configure endpoints to be used from service catalog urls instead of config file """
    response = world.keystone_request.get_token()
    body_keystone_response = raw_httplib_request_to_python_dic(response)

    world.glance_request.glance_url = get_public_endpoint_url_by_type(body_keystone_response,
                                                                      'image', world.region_name)
    world.nova_request.nova_url = get_public_endpoint_url_by_type(body_keystone_response,
                                                                  'compute', world.region_name)
    world.env_requests.paasmanager_url = get_public_endpoint_url_by_type(body_keystone_response,
                                                                         'paas', world.region_name)
    world.inst_requests.paasmanager_url = world.env_requests.paasmanager_url
예제 #2
0
def endpoints_from_service_catalog(step):
    """ Configure endpoints to be used from service catalog urls instead of config file """
    response = world.keystone_request.get_token()
    body_keystone_response = raw_httplib_request_to_python_dic(response)

    world.glance_request.glance_url = get_public_endpoint_url_by_type(
        body_keystone_response, 'image', world.region_name)
    world.nova_request.nova_url = get_public_endpoint_url_by_type(
        body_keystone_response, 'compute', world.region_name)
    world.env_requests.paasmanager_url = get_public_endpoint_url_by_type(
        body_keystone_response, 'paas', world.region_name)
    world.inst_requests.paasmanager_url = world.env_requests.paasmanager_url
예제 #3
0
def a_list_of_tiers_has_been_defined_with_data(step):
    """ Create and add tiers to the environment """
    world.tiers = []
    for row in step.hashes:
        data = dataset_utils.prepare_data(row)

        tier = Tier(data.get(NAME),
                    world.image_sdc_aware_id,
                    tier_flavour=world.flavor_id,
                    tier_region=world.region_name)

        tier.parse_and_add_products(data.get(PRODUCTS))

        if NETWORKS in data:
            # Is Neutron available?
            i_retrieve_the_service_catalog(step)
            body_response = raw_httplib_request_to_python_dic(world.response)
            nova_public_url = get_public_endpoint_url_by_type(
                body_response, 'network', world.region_name)
            if nova_public_url is None:
                raise Exception(
                    "Networks are not available. Region: {}".format(
                        world.region_name))

            tier.parse_and_add_networks(data.get(NETWORKS))

        world.env_requests.add_tier_environment(world.environment_name, tier)
예제 #4
0
파일: steps.py 프로젝트: Fiware/cloud.PaaS
def a_list_of_tiers_has_been_defined_with_data(step):
    """ Create and add tiers to the environment """
    world.tiers = []
    for row in step.hashes:
        data = dataset_utils.prepare_data(row)

        tier = Tier(data.get(NAME), world.image_sdc_aware_id, tier_flavour=world.flavor_id,
                    tier_region=world.region_name)

        tier.parse_and_add_products(data.get(PRODUCTS))

        if NETWORKS in data:
            # Is Neutron available?
            i_retrieve_the_service_catalog(step)
            body_response = raw_httplib_request_to_python_dic(world.response)
            nova_public_url = get_public_endpoint_url_by_type(body_response, 'network', world.region_name)
            if nova_public_url is None:
                raise Exception("Networks are not available. Region: {}".format(world.region_name))

            tier.parse_and_add_networks(data.get(NETWORKS))

        world.env_requests.add_tier_environment(world.environment_name, tier)