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
This commit is contained in:
Feilong Wang 2018-07-02 16:53:12 +12:00
parent 8d787642a5
commit fe7d98bdde
2 changed files with 8 additions and 4 deletions

View File

@ -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,

View File

@ -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.