summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarah Ulmer <sarah.ulmer@ibm.com>2016-08-11 09:21:21 -0500
committerSarah Ulmer <Sarah.Ulmer@ibm.com>2016-08-11 10:54:01 -0500
commit232711c0ef98baf79bcf4c8bdbae4b84003c9ab9 (patch)
treeaf0a32ac8c5307263677878924552ef61cd7bb3e
parent4d971af927256e7e32dcfb5a43d5c4487f9c4af9 (diff)
downloadpython-novaclient-232711c0ef98baf79bcf4c8bdbae4b84003c9ab9.tar.gz
Added smaller flavors for novaclient functional tests to use
Priority is added to pick smaller flavors, m1.nano and m1.micro`, for novaclient functional tests. Functional tests rely on devstack, which should use smaller flavors when available. Closes-Bug: #1611985 Change-Id: Iac75141a3d65b26a3093188ead1b7ed7c65514ad
-rw-r--r--novaclient/tests/functional/base.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/novaclient/tests/functional/base.py b/novaclient/tests/functional/base.py
index eafa2bf6..5d3f95e0 100644
--- a/novaclient/tests/functional/base.py
+++ b/novaclient/tests/functional/base.py
@@ -51,12 +51,10 @@ def is_keystone_version_available(session, version):
# image / flavor list so that they can be used in standard testing.
def pick_flavor(flavors):
"""Given a flavor list pick a reasonable one."""
- for flavor in flavors:
- if flavor.name == 'm1.tiny':
- return flavor
- for flavor in flavors:
- if flavor.name == 'm1.small':
- return flavor
+ for flavor_priority in ('m1.nano', 'm1.micro', 'm1.tiny', 'm1.small'):
+ for flavor in flavors:
+ if flavor.name == flavor_priority:
+ return flavor
raise NoFlavorException()