summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUkesh Kumar Vasudevan <ukeshkumar@gmail.com>2016-08-19 18:10:19 +0530
committerMatt Riedemann <mriedem@us.ibm.com>2016-08-20 08:42:59 -0400
commit48a8e73b86c5d14b153e1246672a4520ea45ccaf (patch)
tree896c8b742b918bbd71e53aceeadb9e2dae9fbef9
parent3c276281ca96c801c4589b8ed53d52384e028703 (diff)
downloadpython-novaclient-stable/liberty.tar.gz
Pick first image if can't find the specific imageliberty-eol2.30.3stable/liberty
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 01de5a9f68ad474e9bfa213ffeb3501066a52ebd) (cherry picked from commit 5bdee97f4843de36669e25aa27874c93451fe05a)
-rw-r--r--novaclient/tests/functional/base.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/novaclient/tests/functional/base.py b/novaclient/tests/functional/base.py
index 0f73aff1..8ac34e59 100644
--- a/novaclient/tests/functional/base.py
+++ b/novaclient/tests/functional/base.py
@@ -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()