]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Eager load snapshot_metadata in *snapshot_get_all
authorMichał Dulko <michal.dulko@intel.com>
Fri, 23 Oct 2015 09:59:48 +0000 (11:59 +0200)
committerMichał Dulko <michal.dulko@intel.com>
Fri, 23 Oct 2015 10:17:36 +0000 (12:17 +0200)
commitab6e2237bf464ec0c4c432ec6047a98cb30db6c5
tree484fd3725562da255f469bc73dbf0adc0cd0e0b0
parentcaa7940db4c0ce562b07e37cece6fe425ab4c896
Eager load snapshot_metadata in *snapshot_get_all

All methods returning snapshot lists in db.sqlalchemy.api are eager
loading snapshot_metadata - besides snapshot_get_all_by_project and
snapshot_get_active_by_window. In case of the latter that fact caused
unit tests to randomly fail because of SQLAlchemy Session sometimes
getting closed before the metadata got lazy loaded. This commit adds
missing options(joinedload('snapshot_metadata')) to these queries.

Change-Id: I72557ebc7af9f3044046965ca79c9fe7c15520fc
Closes-Bug: 1501838
cinder/db/sqlalchemy/api.py