Pick first image if can't find the specific image

In pick_image method to just pick the first image it finds
if it can't find the specific cirros-*uec image.

Also look for the -disk.img since devstack is changing
the default image in:

Id65ebae73b28da7185cb349b714b659af51ef77f

Change-Id: I0e4c38a9e0ae25a922f6b0e09f3f2531f49c88c9
Closes-Bug: 1614118
(cherry picked from commit 01de5a9f68)
(cherry picked from commit 5bdee97f48)
This commit is contained in:
Ukesh Kumar Vasudevan 2016-08-19 18:10:19 +05:30 committed by Matt Riedemann
parent 3c276281ca
commit 48a8e73b86
1 changed files with 9 additions and 1 deletions

View File

@ -38,8 +38,16 @@ def pick_flavor(flavors):
def pick_image(images):
for image in images:
if image.name.startswith('cirros') and image.name.endswith('-uec'):
if image.name.startswith('cirros') and (
image.name.endswith('-uec') or
image.name.endswith('-disk.img')):
return image
# We didn't find the specific cirros image we'd like to use, so just use
# the first available.
if images:
return images[0]
raise NoImageException()