aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/functest_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'testcases/functest_utils.py')
-rw-r--r--testcases/functest_utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py
index e76ef991..9c618f75 100644
--- a/testcases/functest_utils.py
+++ b/testcases/functest_utils.py
@@ -88,6 +88,12 @@ def get_instance_by_name(nova_client, instance_name):
except:
return None
+def create_flavor(nova_client, flavor_name, ram, disk, vcpus):
+ try:
+ flavor = nova_client.flavors.create(flavor_name,ram,vcpus,disk)
+ except:
+ return None
+ return flavor.id
def get_flavor_id(nova_client, flavor_name):
flavors = nova_client.flavors.list(detailed=True)