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
This commit is contained in:
parent
131e0cf098
commit
e3bcc2440a
@ -142,7 +142,7 @@ class DeployStackAction(templates.ProcessTemplatesAction):
|
|||||||
# check to see if the stack exists
|
# check to see if the stack exists
|
||||||
heat = self.get_orchestration_client(context)
|
heat = self.get_orchestration_client(context)
|
||||||
try:
|
try:
|
||||||
stack = heat.stacks.get(self.container)
|
stack = heat.stacks.get(self.container, resolve_outputs=False)
|
||||||
except heat_exc.HTTPNotFound:
|
except heat_exc.HTTPNotFound:
|
||||||
stack = None
|
stack = None
|
||||||
|
|
||||||
|
@ -110,8 +110,7 @@ class DeletePlanAction(base.TripleOAction):
|
|||||||
# heat throws HTTPNotFound if the stack is not found
|
# heat throws HTTPNotFound if the stack is not found
|
||||||
try:
|
try:
|
||||||
stack = self.get_orchestration_client(context).stacks.get(
|
stack = self.get_orchestration_client(context).stacks.get(
|
||||||
self.container
|
self.container, resolve_outputs=False)
|
||||||
)
|
|
||||||
except heatexceptions.HTTPNotFound:
|
except heatexceptions.HTTPNotFound:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
@ -262,7 +262,8 @@ class DeletePlanActionTest(base.TestCase):
|
|||||||
# test that stack exists
|
# test that stack exists
|
||||||
action = plan.DeletePlanAction(self.container_name)
|
action = plan.DeletePlanAction(self.container_name)
|
||||||
self.assertRaises(exception.StackInUseError, action.run, self.ctx)
|
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('tripleo_common.actions.base.TripleOAction.get_object_client')
|
||||||
@mock.patch(
|
@mock.patch(
|
||||||
|
Loading…
Reference in New Issue
Block a user