]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Eager load volume extra specs
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 25 Mar 2015 16:01:02 +0000 (18:01 +0200)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 25 Mar 2015 20:32:08 +0000 (22:32 +0200)
commit19f6b7703663e12836fd6805e8c20b5507ede098
tree1186e95e68ebbb672daf837b4dd2c681e7b56988
parent37713115be3dec1a92e47906fa96d205d77a4274
Eager load volume extra specs

The Linux SMBFS driver uses volume extra specs in order to determine
the according image format when creating new volumes.

Accessing the extra_specs attribute can raise DetachedInstanceError
as this attribute is lazy loaded and the session might close by the
time this attribute is accessed.

This can be avoided by simply eager loading the volume extra specs.

Change-Id: Iffdb160a4a968067261aa90638832782caed5ed0
Closes-Bug: #1436418
cinder/db/sqlalchemy/api.py
cinder/tests/test_db_api.py