Browse Source

Fix expensive api call to get deployment_name

We filter all resources for overcloud root stack with a
non-indexed field 'physical_resource_id' (nova_instance).
This is very inefficient.

With this patch, though there would still be making heat api
calls for every deployment, it won't be so expensive.

Change-Id: I260501e6061c0d6652b22504e7284940b2c64709
Closes-Bug: #1838861
(cherry picked from commit 3df3719e82)
tags/8.7.1
Rabi Mishra 1 month ago
parent
commit
e3ca555245
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      tripleo_common/utils/config.py

+ 3
- 2
tripleo_common/utils/config.py View File

@@ -259,9 +259,10 @@ class Config(object):
259 259
                 deployment_stack = self.client.stacks.get(
260 260
                     deployment_stack_id, resolve_outputs=False)
261 261
                 parent_stack = deployment_stack.parent
262
+                grandparent_stack = self.client.stacks.get(
263
+                    parent_stack, resolve_outputs=False).parent
262 264
                 resources = self.client.resources.list(
263
-                    name,
264
-                    nested_depth=constants.NESTED_DEPTH,
265
+                    grandparent_stack,
265 266
                     filters=dict(physical_resource_id=parent_stack))
266 267
                 if not resources:
267 268
                     message = "The deployment resource grandparent name could" \

Loading…
Cancel
Save