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/9.6.1
Rabi Mishra 1 month ago
parent
commit
652aad411f
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

@@ -315,9 +315,10 @@ class Config(object):
315 315
                 deployment_stack = self.client.stacks.get(
316 316
                     deployment_stack_id, resolve_outputs=False)
317 317
                 parent_stack = deployment_stack.parent
318
+                grandparent_stack = self.client.stacks.get(
319
+                    parent_stack, resolve_outputs=False).parent
318 320
                 resources = self.client.resources.list(
319
-                    name,
320
-                    nested_depth=constants.NESTED_DEPTH,
321
+                    grandparent_stack,
321 322
                     filters=dict(physical_resource_id=parent_stack))
322 323
                 if not resources:
323 324
                     message = "The deployment resource grandparent name could" \

Loading…
Cancel
Save