Accept glance image ID in addition to name
Add a check to accept the image ID if provided. Currently only the name is checked. Change-Id: I7c02079debd13c743b84e91ddd226a4b365f6b77 Closes-Bug: 1710717
This commit is contained in:
parent
923658a720
commit
896b2492ee
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- Accept the glance image ID in addition to the name.
|
|
@ -53,7 +53,8 @@ def _upload_file(glanceclient, name, path, disk_format, type_name,
|
||||||
disk_format=disk_format)
|
disk_format=disk_format)
|
||||||
image = None
|
image = None
|
||||||
for img in images:
|
for img in images:
|
||||||
if img['name'] == name and img['disk_format'] == disk_format:
|
if ((img['name'] == name or img['id'] == name) and
|
||||||
|
img['disk_format'] == disk_format):
|
||||||
image = img
|
image = img
|
||||||
if not image:
|
if not image:
|
||||||
raise exceptions.NotFound("No image found")
|
raise exceptions.NotFound("No image found")
|
||||||
|
|
Loading…
Reference in New Issue