Pass in `region_name` to get correct heat endpoint

In a multi regions openstack cloud, when user create a cluster in the
one region, heat-container-agent may try to get stack data from the
other regions and will definitely fail because currently
heat-container-agent doesn't pass "region_name" when searching for
Heat endpoints. This patch fixes the issue by passing the region
name.

Please refer the fix Iec6f3606c9fdf8474f393b0990356f34d38bcf75 on
Heat side.

Task: 22627
Story: 2002768

Change-Id: I88016482e887ce0b0fa309199abd27cf0e777e2c
(cherry picked from commit 2521afa3dc)
This commit is contained in:
Feilong Wang 2018-06-29 14:51:17 +12:00 committed by Mohammed Naser
parent ff6c64b426
commit 62b0f2236f
2 changed files with 6 additions and 2 deletions

View File

@ -123,7 +123,8 @@ def main(argv=sys.argv, stdin=sys.stdin):
password=iv['deploy_password'],
project_id=iv['deploy_project_id'])
endpoint = ks.service_catalog.url_for(
service_type='messaging', endpoint_type='publicURL')
service_type='messaging', endpoint_type='publicURL',
region_name=iv.get('deploy_region_name')
conf = {
'auth_opts': {
@ -146,7 +147,8 @@ def main(argv=sys.argv, stdin=sys.stdin):
password=iv['deploy_password'],
project_id=iv['deploy_project_id'])
endpoint = ks.service_catalog.url_for(
service_type='orchestration', endpoint_type='publicURL')
service_type='orchestration', endpoint_type='publicURL',
region_name=iv.get('deploy_region_name'))
log.debug('Signalling to %s' % endpoint)
heat = heatclient.Client(
'1', endpoint, token=ks.auth_token)

View File

@ -45,6 +45,7 @@ password = {{password}}
project_id = {{project_id}}
stack_id = {{stack_id}}
resource_name = {{resource_name}}
region_name = {{region_name}}
{{/heat}}
{{#zaqar}}
@ -54,6 +55,7 @@ user_id = {{user_id}}
password = {{password}}
project_id = {{project_id}}
queue_id = {{queue_id}}
region_name = {{region_name}}
{{/zaqar}}
{{#request}}