From fe7d98bdde01cbf60bbf09bf46c5c6990f6b807e Mon Sep 17 00:00:00 2001 From: Feilong Wang Date: Mon, 2 Jul 2018 16:53:12 +1200 Subject: [PATCH] Support region_name for software deployment In magnum, we're running into a problem that the heat-container-agent can't get the region name. As a result, it can't get the correct Heat endpoint, which is causing problems. This patch fixes this from heat side. Task: 22661 Story: 2002781 Change-Id: Iec6f3606c9fdf8474f393b0990356f34d38bcf75 --- .../resources/openstack/heat/software_deployment.py | 8 +++++--- heat/engine/resources/signal_responder.py | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/heat/engine/resources/openstack/heat/software_deployment.py b/heat/engine/resources/openstack/heat/software_deployment.py index ba91872882..ba428eb952 100644 --- a/heat/engine/resources/openstack/heat/software_deployment.py +++ b/heat/engine/resources/openstack/heat/software_deployment.py @@ -101,7 +101,7 @@ class SoftwareDeployment(signal_responder.SignalResponder): DEPLOY_USERNAME, DEPLOY_PASSWORD, DEPLOY_PROJECT_ID, DEPLOY_USER_ID, DEPLOY_SIGNAL_VERB, DEPLOY_SIGNAL_TRANSPORT, - DEPLOY_QUEUE_ID + DEPLOY_QUEUE_ID, DEPLOY_REGION_NAME ) = ( 'deploy_server_id', 'deploy_action', 'deploy_signal_id', 'deploy_stack_id', @@ -109,7 +109,7 @@ class SoftwareDeployment(signal_responder.SignalResponder): 'deploy_username', 'deploy_password', 'deploy_project_id', 'deploy_user_id', 'deploy_signal_verb', 'deploy_signal_transport', - 'deploy_queue_id' + 'deploy_queue_id', 'deploy_region_name' ) SIGNAL_TRANSPORTS = ( @@ -416,7 +416,9 @@ class SoftwareDeployment(signal_responder.SignalResponder): yield swc_io.InputConfig( name=self.DEPLOY_PROJECT_ID, value=creds['project_id'], description=_('ID of project for API authentication')) - + yield swc_io.InputConfig( + name=self.DEPLOY_REGION_NAME, value=creds['region_name'], + description=_('Region name for API authentication')) if self._signal_transport_zaqar(): yield swc_io.InputConfig( name=self.DEPLOY_QUEUE_ID, diff --git a/heat/engine/resources/signal_responder.py b/heat/engine/resources/signal_responder.py index 47a34ce2b3..23c1f9c76a 100644 --- a/heat/engine/resources/signal_responder.py +++ b/heat/engine/resources/signal_responder.py @@ -108,7 +108,9 @@ class SignalResponder(stack_user.StackUser): 'user_id': self._get_user_id(), 'password': self.password, 'project_id': self.stack.stack_user_project_id, - 'domain_id': self.keystone().stack_domain_id} + 'domain_id': self.keystone().stack_domain_id, + 'region_name': (self.context.region_name or + cfg.CONF.region_name_for_services)} def _get_ec2_signed_url(self, signal_type=SIGNAL): """Create properly formatted and pre-signed URL.