]> review.fuel-infra Code Review - openstack-build/heat-build.git/commit
Pass a Stack entity to Stack.load().
authorSteve Baker <sbaker@redhat.com>
Sun, 11 Nov 2012 19:38:38 +0000 (08:38 +1300)
committerSteve Baker <sbaker@redhat.com>
Sun, 11 Nov 2012 19:49:12 +0000 (08:49 +1300)
commit8f2993610d0f12f7e711107eaf56db3d28b112b0
tree35c269f847fe2505626a04a2cea9b066bd4932eb
parentec8d548b88d94695c847ec5887f916a7f80dcca5
Pass a Stack entity to Stack.load().

Every call to Stack.load (except one) is loading models.Stack then passing just
the ID to Stack.load, which then loads models.Stack again.

As far as I can tell, SQLAlchemy doesn't have a 2nd level cache, so this results
in the db being queried twice.

This change makes it possibe to pass a stack *or* an ID to Stack.load, and
converts all calls to pass in a stack if it is available.

Change-Id: I501ebd403a241cc3b4a5c1e3070137cfc360bbda
heat/engine/api.py
heat/engine/parser.py
heat/engine/service.py
heat/engine/watchrule.py
heat/tests/test_api_cfn_v1.py
heat/tests/test_api_openstack_v1.py
heat/tests/test_engine_service.py