Browse Source

Add region_name for heat-config-notify

Now there is no region name when heat-config-notify try to get the
heat endpoint or zaqar endpoint. As a result, it could be a wrong
one returned from Keystone because there is no region name specified.
This patch fixes it.

Please refer Iec6f3606c9fdf8474f393b0990356f34d38bcf75 for the change
in Heat.

Please refer I88182a9a9af74e9760b2ec9b500971f06293f0b8 for the change
in occ.

Task: 22720
Story: 2002781

Change-Id: I8e0518fa61e237ec055834dd4bebe0fc87cd6627
changes/69/579669/4 1.7.0
Feilong Wang 3 years ago
parent
commit
fdd6a5f537
  1. 6
      heat-config/bin/heat-config-notify
  2. 2
      heat-config/os-apply-config/etc/os-collect-config.conf
  3. 6
      tests/test_heat_config_notify.py

6
heat-config/bin/heat-config-notify

@ -139,7 +139,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': {
@ -162,7 +163,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)

2
heat-config/os-apply-config/etc/os-collect-config.conf

@ -41,6 +41,7 @@ password = {{password}}
project_id = {{project_id}}
stack_id = {{stack_id}}
resource_name = {{resource_name}}
region_name = {{region_name}}
{{/heat}}
{{#zaqar}}
@ -50,6 +51,7 @@ user_id = {{user_id}}
password = {{password}}
project_id = {{project_id}}
queue_id = {{queue_id}}
region_name = {{region_name}}
{{#use_websockets}}
use_websockets = {{.}}
{{/use_websockets}}

6
tests/test_heat_config_notify.py

@ -68,6 +68,9 @@ class HeatConfigNotifyTest(common.RunScriptTest):
}, {
'name': 'deploy_resource_name',
'value': 'the_resource'
}, {
'name': 'deploy_region_name',
'value': 'RegionOne'
}],
'config': 'five'
}
@ -237,7 +240,8 @@ class HeatConfigNotifyTest(common.RunScriptTest):
password='password',
project_id='bbbb')
ks.service_catalog.url_for.assert_called_once_with(
service_type='orchestration', endpoint_type='publicURL')
service_type='orchestration', endpoint_type='publicURL',
region_name='RegionOne')
heatclient.Client.assert_called_once_with(
'1', 'mock://192.0.2.3/heat', token=ks.auth_token)

Loading…
Cancel
Save