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
Feilong Wang 9 months ago
parent
commit
fdd6a5f537

+ 4
- 2
heat-config/bin/heat-config-notify View File

@@ -139,7 +139,8 @@ def main(argv=sys.argv, stdin=sys.stdin):
139 139
             password=iv['deploy_password'],
140 140
             project_id=iv['deploy_project_id'])
141 141
         endpoint = ks.service_catalog.url_for(
142
-            service_type='messaging', endpoint_type='publicURL')
142
+            service_type='messaging', endpoint_type='publicURL',
143
+            region_name=iv.get('deploy_region_name'))
143 144
 
144 145
         conf = {
145 146
             'auth_opts': {
@@ -162,7 +163,8 @@ def main(argv=sys.argv, stdin=sys.stdin):
162 163
             password=iv['deploy_password'],
163 164
             project_id=iv['deploy_project_id'])
164 165
         endpoint = ks.service_catalog.url_for(
165
-            service_type='orchestration', endpoint_type='publicURL')
166
+            service_type='orchestration', endpoint_type='publicURL',
167
+            region_name=iv.get('deploy_region_name'))
166 168
         log.debug('Signalling to %s' % endpoint)
167 169
         heat = heatclient.Client(
168 170
             '1', endpoint, token=ks.auth_token)

+ 2
- 0
heat-config/os-apply-config/etc/os-collect-config.conf View File

@@ -41,6 +41,7 @@ password = {{password}}
41 41
 project_id = {{project_id}}
42 42
 stack_id = {{stack_id}}
43 43
 resource_name = {{resource_name}}
44
+region_name = {{region_name}}
44 45
 {{/heat}}
45 46
 
46 47
 {{#zaqar}}
@@ -50,6 +51,7 @@ user_id = {{user_id}}
50 51
 password = {{password}}
51 52
 project_id = {{project_id}}
52 53
 queue_id = {{queue_id}}
54
+region_name = {{region_name}}
53 55
 {{#use_websockets}}
54 56
 use_websockets = {{.}}
55 57
 {{/use_websockets}}

+ 5
- 1
tests/test_heat_config_notify.py View File

@@ -68,6 +68,9 @@ class HeatConfigNotifyTest(common.RunScriptTest):
68 68
         }, {
69 69
             'name': 'deploy_resource_name',
70 70
             'value': 'the_resource'
71
+        }, {
72
+            'name': 'deploy_region_name',
73
+            'value': 'RegionOne'
71 74
         }],
72 75
         'config': 'five'
73 76
     }
@@ -237,7 +240,8 @@ class HeatConfigNotifyTest(common.RunScriptTest):
237 240
             password='password',
238 241
             project_id='bbbb')
239 242
         ks.service_catalog.url_for.assert_called_once_with(
240
-            service_type='orchestration', endpoint_type='publicURL')
243
+            service_type='orchestration', endpoint_type='publicURL',
244
+            region_name='RegionOne')
241 245
 
242 246
         heatclient.Client.assert_called_once_with(
243 247
             '1', 'mock://192.0.2.3/heat', token=ks.auth_token)

Loading…
Cancel
Save