From 2521afa3dc6acbb6575d31e68b4bc8fa0ac33eff Mon Sep 17 00:00:00 2001 From: Feilong Wang Date: Fri, 29 Jun 2018 14:51:17 +1200 Subject: [PATCH] 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 --- .../image/heat-container-agent/scripts/heat-config-notify | 6 ++++-- .../scripts/write-os-apply-config-templates.sh | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/magnum/drivers/common/image/heat-container-agent/scripts/heat-config-notify b/magnum/drivers/common/image/heat-container-agent/scripts/heat-config-notify index eba1258644..f479519bc4 100755 --- a/magnum/drivers/common/image/heat-container-agent/scripts/heat-config-notify +++ b/magnum/drivers/common/image/heat-container-agent/scripts/heat-config-notify @@ -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) diff --git a/magnum/drivers/common/image/heat-container-agent/scripts/write-os-apply-config-templates.sh b/magnum/drivers/common/image/heat-container-agent/scripts/write-os-apply-config-templates.sh index 15b3aa57db..750f580bd4 100644 --- a/magnum/drivers/common/image/heat-container-agent/scripts/write-os-apply-config-templates.sh +++ b/magnum/drivers/common/image/heat-container-agent/scripts/write-os-apply-config-templates.sh @@ -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}}