Use the make_url function in the endpoint map
Change-Id: I6cfc8762bf3ea9f79ba53f9860326bf746630110
This commit is contained in:

committed by
Steven Hardy

parent
774e41199e
commit
e7b51efc5d
@@ -150,9 +150,19 @@ def template_output_definition(endpoint_name,
|
|||||||
})
|
})
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
uri_fields = [protocol, '://', copy.deepcopy(host), ':', port]
|
uri_no_path = {
|
||||||
uri_fields_suffix = (copy.deepcopy(uri_fields) +
|
'make_url': collections.OrderedDict([
|
||||||
([uri_suffix] if uri_suffix is not None else []))
|
('scheme', protocol),
|
||||||
|
('host', copy.deepcopy(host)),
|
||||||
|
('port', port)
|
||||||
|
])
|
||||||
|
}
|
||||||
|
uri_with_path = copy.deepcopy(uri_no_path)
|
||||||
|
if uri_suffix is not None:
|
||||||
|
path, pc, suffix = uri_suffix.partition('%')
|
||||||
|
uri_with_path['make_url']['path'] = path
|
||||||
|
if pc:
|
||||||
|
uri_with_path = {'list_join': ['', [uri_with_path, pc + suffix]]}
|
||||||
|
|
||||||
name = name_override if name_override is not None else (endpoint_name +
|
name = name_override if name_override is not None else (endpoint_name +
|
||||||
endpoint_variant +
|
endpoint_variant +
|
||||||
@@ -163,12 +173,8 @@ def template_output_definition(endpoint_name,
|
|||||||
'host': host,
|
'host': host,
|
||||||
'port': extract_field('port'),
|
'port': extract_field('port'),
|
||||||
'protocol': extract_field('protocol'),
|
'protocol': extract_field('protocol'),
|
||||||
'uri': {
|
'uri': uri_with_path,
|
||||||
'list_join': ['', uri_fields_suffix]
|
'uri_no_suffix': uri_no_path,
|
||||||
},
|
|
||||||
'uri_no_suffix': {
|
|
||||||
'list_join': ['', uri_fields]
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user