From 02e7f70619ad44b350210dd09b3eef616bf96cb7 Mon Sep 17 00:00:00 2001 From: Crag Wolfe Date: Thu, 16 Feb 2017 21:24:36 +0000 Subject: [PATCH] Don't eager load raw_template in a few places Save the db and memory overhead associated with fetching a raw_template when soft-deleting a stack or getting a root stack id. Change-Id: I8cf575e4908764c4c5eb24185ec229254e30d58b --- heat/db/sqlalchemy/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/heat/db/sqlalchemy/api.py b/heat/db/sqlalchemy/api.py index e16a7e0414..d0db40fa22 100644 --- a/heat/db/sqlalchemy/api.py +++ b/heat/db/sqlalchemy/api.py @@ -685,7 +685,7 @@ def stack_update(context, stack_id, values, exp_trvsl=None): def stack_delete(context, stack_id): - s = stack_get(context, stack_id) + s = stack_get(context, stack_id, eager_load=False) if not s: raise exception.NotFound(_('Attempt to delete a stack with id: ' '%(id)s %(msg)s') % { @@ -752,11 +752,11 @@ def stack_lock_release(context, stack_id, engine_id): def stack_get_root_id(context, stack_id): - s = stack_get(context, stack_id) + s = stack_get(context, stack_id, eager_load=False) if not s: return None while s.owner_id: - s = stack_get(context, s.owner_id) + s = stack_get(context, s.owner_id, eager_load=False) return s.id