X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=network%2Fendpoints%2Fbuild_endpoint_map.py;h=42eb1186ba022ba619c2e1b6701ad0e01a829156;hb=0a0e2ee629a143efe29bb00ffb06c90515f0e504;hp=3110f3f7da5fe63d2cdad4bf4c11409daf6e3af9;hpb=25b60832bd11b1395d51587a7747b0c7d514fee4;p=apex-tripleo-heat-templates.git diff --git a/network/endpoints/build_endpoint_map.py b/network/endpoints/build_endpoint_map.py index 3110f3f7..42eb1186 100755 --- a/network/endpoints/build_endpoint_map.py +++ b/network/endpoints/build_endpoint_map.py @@ -30,9 +30,9 @@ import yaml (IN_FILE, OUT_FILE) = ('endpoint_data.yaml', 'endpoint_map.yaml') SUBST = (SUBST_IP_ADDRESS, SUBST_CLOUDNAME) = ('IP_ADDRESS', 'CLOUDNAME') -PARAMS = (PARAM_CLOUDNAME, PARAM_ENDPOINTMAP, PARAM_NETIPMAP, +PARAMS = (PARAM_CLOUD_ENDPOINTS, PARAM_ENDPOINTMAP, PARAM_NETIPMAP, PARAM_SERVICENETMAP) = ( - 'CloudName', 'EndpointMap', 'NetIpMap', 'ServiceNetMap') + 'CloudEndpoints', 'EndpointMap', 'NetIpMap', 'ServiceNetMap') FIELDS = (F_PORT, F_PROTOCOL, F_HOST) = ('port', 'protocol', 'host') ENDPOINT_TYPES = frozenset(['Internal', 'Public', 'Admin']) @@ -95,10 +95,11 @@ def template_parameters(config): 'via parameter_defaults in the ' 'resource registry.') - params[PARAM_CLOUDNAME] = make_parameter('string', - 'overcloud', - 'The DNS name of this cloud. ' - 'e.g. ci-overcloud.tripleo.org') + params[PARAM_CLOUD_ENDPOINTS] = make_parameter( + 'json', + {}, + ('A map containing the DNS names for the different endpoints ' + '(external, internal_api, etc.)')) return params @@ -124,7 +125,10 @@ def template_output_definition(endpoint_name, ['NetIpMap', {'get_param': ['ServiceNetMap', net_param]}]}, - SUBST_CLOUDNAME: {'get_param': PARAM_CLOUDNAME}, + SUBST_CLOUDNAME: {'get_param': + [PARAM_CLOUD_ENDPOINTS, + {'get_param': ['ServiceNetMap', + net_param]}]}, }) ]) } @@ -139,7 +143,10 @@ def template_output_definition(endpoint_name, 'params': {'NETWORK': {'get_param': ['ServiceNetMap', net_param]}}}}]}, - SUBST_CLOUDNAME: {'get_param': PARAM_CLOUDNAME}, + SUBST_CLOUDNAME: {'get_param': + [PARAM_CLOUD_ENDPOINTS, + {'get_param': ['ServiceNetMap', + net_param]}]}, }) ]) } @@ -184,7 +191,7 @@ def template_endpoint_items(config): def generate_endpoint_map_template(config): return collections.OrderedDict([ - ('heat_template_version', '2015-04-30'), + ('heat_template_version', 'pike'), ('description', 'A map of OpenStack endpoints. Since the endpoints ' 'are URLs, we need to have brackets around IPv6 IP addresses. The ' 'inputs to these parameters come from net_ip_uri_map, which will ' @@ -273,8 +280,9 @@ def main(): try: if options.check: if not check_up_to_date(options.output_file, options.input_file): - print('EndpointMap template does not match input data', - file=sys.stderr) + print('EndpointMap template does not match input data. Please ' + 'run the build_endpoint_map.py tool to update the ' + 'template.', file=sys.stderr) sys.exit(2) else: build_endpoint_map(options.output_file, options.input_file)