Add ability to create volume from image by image name.
authorSean McGinnis <sean_mcginnis@dell.com>
Tue, 4 Nov 2014 11:15:26 +0000 (12:15 +0100)
committerSean McGinnis <sean_mcginnis@dell.com>
Mon, 24 Nov 2014 15:33:19 +0000 (09:33 -0600)
commit01ac8436761d5d1297cfd2555e573c1bfd576e72
tree770fe4f359b1c8065fbd5ce67c8bb8ff5c2e07db
parent0fb250bff8ac278a27979815aa1c4885f4f37af4
Add ability to create volume from image by image name.

Some cli commands allow specifying an image by either
its name or its ID. Creating a volume from an image
currently requires knowing the image ID. The request
was made to add the ability to create a volume using
the image name instead.

This patch adds the ability to accept either name or ID.
It will attempt to locate the image based on this input
and fail if neither can be matched. If found by name, it
will also verify there are not multiple images of the
same name. If this is the case it will require using the
ID to be explicit.

Will update python-cinderclient in a separate patch once
this has been merged to allow ID or name.

Change-Id: I8b522ccff3ead644b738499e67fa85d4ab92af36
Partial-Bug: #1377823
cinder/api/v2/volumes.py
cinder/tests/api/v2/stubs.py
cinder/tests/api/v2/test_volumes.py