glance_metadata_get() should raise exception if no records in DB

Bug #1211632 reported by Huang Zhiteng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
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)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/41601

summary: - glance_metadata_get() should raise exception is no records in DB
+ glance_metadata_get() should raise exception if no records in DB
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

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)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: havana-3 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.