]> review.fuel-infra Code Review - openstack-build/heat-build.git/commit
avoid excessive database calls while loading events
authorLiang Chen <cbjchen@cn.ibm.com>
Sun, 7 Jul 2013 06:43:45 +0000 (14:43 +0800)
committerLiang Chen <cbjchen@cn.ibm.com>
Thu, 11 Jul 2013 07:32:25 +0000 (15:32 +0800)
commit3fa39dd2ccc9013cfba4ec8bd5fb79caeba0350e
treec3de53af60c2b7a7b00278560af4b2cd614e6b71
parent78d38ab038b3fa1d3dfa2f22f0952f37be07dde2
avoid excessive database calls while loading events

list_events constructs Event objects through Event.load, which causes
every event record previously loaded into memory to be reloaded again.
Furthermore, Event.load will also reload the associated stack, thus
all its resources and template. Another bad thing with that is
reloading a stack will lead to many extra stack static resolution
(including calls to nova to resovle Fn::GetAZs if it's referenced in
the template).

Fixes bug #1195793

Change-Id: I4f14c9a2a4f990b753a6e1405e27eb44c53537c9
heat/engine/event.py
heat/engine/service.py
heat/tests/test_engine_service.py
heat/tests/test_event.py