glance_metadata_get() should raise exception if no records in DB

Bug #1211632 reported by Huang Zhiteng on 2013-08-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Low
Huang Zhiteng

Bug Description

Currently glance metadata query functions (volume_glance_metadata_get(), volume_snapshot_glance_metadata_get()) return nothing when no metadata exists for volume/snapshot. It'd be better to raise GlanceMetaDataNotFound() rather than failing silently.

Changed in cinder:
assignee: nobody → Huang Zhiteng (zhiteng-huang)
summary: - glance_metadata_get() should raise exception is no records in DB
+ glance_metadata_get() should raise exception if no records in DB

Reviewed: https://review.openstack.org/41601
Committed: http://github.com/openstack/cinder/commit/3e68c6be7405bb239ad7d2c82117344bdddcfa99
Submitter: Jenkins
Branch: master

commit 3e68c6be7405bb239ad7d2c82117344bdddcfa99
Author: Zhiteng Huang <email address hidden>
Date: Tue Aug 13 12:57:17 2013 +0800

    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

Changed in cinder:
status: Confirmed → Fix Committed
Thierry Carrez (ttx) on 2013-09-05
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in cinder:
milestone: havana-3 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers