]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Raise exception when Glance metadata not found.
authorZhiteng Huang <zhithuang@ebaysf.com>
Tue, 13 Aug 2013 04:57:17 +0000 (12:57 +0800)
committerZhiteng Huang <zhithuang@ebaysf.com>
Wed, 14 Aug 2013 04:27:07 +0000 (12:27 +0800)
commit3e68c6be7405bb239ad7d2c82117344bdddcfa99
tree780f3e0777fa2c10993532ede33dc229f6c09a9c
parentafd45fe6fd8e17cdfee2a31cbd15e4f7438a76cb
Raise exception when Glance metadata not found.

It'd be better to raise exception when trying to copy Glance metadata
from source (volume/snapshot) to destination (volume/snapshot) rather
than silent failure, which is exactly the reason there's unspotted error
inside glance_meta unittest but it was able to pass.
With this fix, one should _not_ directly call glance_metadata_copy()
without looking at source's bootable flags.  This patch also refactors
_create_volume_from_snapshot() and _create_from_source_volume() to only
do Glance metadata copy when needed (bootable is True).

Fix bug: 1211632

Change-Id: I28f065e21cf24c81f98b00e171fcbe4f64ec76b6
cinder/db/sqlalchemy/api.py
cinder/exception.py
cinder/tests/test_volume_glance_metadata.py
cinder/volume/flows/create_volume.py
cinder/volume/manager.py