Mutually exclusive options snapshot-id, source-volid and image-id are not correctly enforced

Bug #1161437 reported by stephen mulcahy on 2013-03-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Undecided
stephen mulcahy

Bug Description

At most only one of snapshot-id, source-volid or image-id should be specified during a volume creation. At the moment, the volumes api only partially enforces this, accepting some combinations of these arguments and silently ignoring them.

cinder/volume/api.py line 92 has check

        if ((snapshot is not None) and (source_volume is not None)):

i.e., no check for image_id/imageRef

and

cinder/api/v1/volumes.py and cinder/api/v2/volumes.py

has the check

if snapshot_id and image_href:

i.e. no check for combination of image_id/ImageRef and source volume

Changed in cinder:
assignee: nobody → stephen mulcahy (stephen-mulcahy)
Changed in cinder:
status: New → Confirmed

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

Changed in cinder:
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/25624
Committed: http://github.com/openstack/cinder/commit/a4540aae666347c1a7e6f17330232a5d33cc4893
Submitter: Jenkins
Branch: master

commit a4540aae666347c1a7e6f17330232a5d33cc4893
Author: Stephen Mulcahy <email address hidden>
Date: Thu Mar 28 15:46:16 2013 +0000

    Enforce exclusive options snapshot-id, source-volid and image-id

    Fixed checks in api that volume create receives only one of
    snapshot-id, source-volid or image-id.

    Fixes bug #1161437

    Change-Id: Ibe5ca4bb81e69b0f8e1abe1c2cffe587dc10e3ca

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

Other bug subscribers