Don't resolve Heat stack output when unnecessary

Retrieving the overcloud stack with its outputs is expensive for Heat,
let's skip it where we can.

Change-Id: Ifacdff939f7a8dedbcf2685595ebeb9340af092a
(cherry picked from commit e3bcc2440a)
This commit is contained in:
Thomas Herve 2018-10-30 09:21:08 +01:00 committed by Emilien Macchi
parent 543bd0d280
commit 9366893503
3 changed files with 4 additions and 4 deletions

View File

@ -143,7 +143,7 @@ class DeployStackAction(templates.ProcessTemplatesAction):
# check to see if the stack exists
heat = self.get_orchestration_client(context)
try:
stack = heat.stacks.get(self.container)
stack = heat.stacks.get(self.container, resolve_outputs=False)
except heat_exc.HTTPNotFound:
stack = None

View File

@ -110,8 +110,7 @@ class DeletePlanAction(base.TripleOAction):
# heat throws HTTPNotFound if the stack is not found
try:
stack = self.get_orchestration_client(context).stacks.get(
self.container
)
self.container, resolve_outputs=False)
except heatexceptions.HTTPNotFound:
pass
else:

View File

@ -262,7 +262,8 @@ class DeletePlanActionTest(base.TestCase):
# test that stack exists
action = plan.DeletePlanAction(self.container_name)
self.assertRaises(exception.StackInUseError, action.run, self.ctx)
heat.stacks.get.assert_called_with(self.container_name)
heat.stacks.get.assert_called_with(
self.container_name, resolve_outputs=False)
@mock.patch('tripleo_common.actions.base.TripleOAction.get_object_client')
@mock.patch(