diff options
author | George Paraskevopoulos <geopar@intracom-telecom.com> | 2016-09-23 16:40:13 +0300 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2016-09-27 10:05:54 +0000 |
commit | e3fb755f81a297b484dbcb764e9f054afc30f85b (patch) | |
tree | e6b866ac95b1d4676cf218a70b5010ecea2cf6b1 /utils | |
parent | bc8056383ce9154ecbe7a919ac10307ea7bd67ad (diff) |
Move sfc custom flavor creation
The custom flavor that is needed for the sfc test case is created in the
tacker deployment phase.
The result of this is that when we use alternative methods of deploying
tacker (i.e. the tacker fuel plugin) the test fails.
Changes:
- Move the flavor creation inside the test case code
- Add an optional public parameter in the [get_or_]create_flavor utility
functions.
Change-Id: Iea13f172076770dde3876b7e27edc9b7ca9b28db
Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
(cherry picked from commit 40f68e35389cf19d3fb200d1655ecb055c85d1eb)
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/openstack_utils.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/utils/openstack_utils.py b/utils/openstack_utils.py index 80815943b..57e96cd9e 100755 --- a/utils/openstack_utils.py +++ b/utils/openstack_utils.py @@ -211,9 +211,10 @@ def get_flavor_id_by_ram_range(nova_client, min_ram, max_ram): return id -def create_flavor(nova_client, flavor_name, ram, disk, vcpus): +def create_flavor(nova_client, flavor_name, ram, disk, vcpus, public=True): try: - flavor = nova_client.flavors.create(flavor_name, ram, vcpus, disk) + flavor = nova_client.flavors.create( + flavor_name, ram, vcpus, disk, is_public=public) try: extra_specs = ft_utils.get_functest_config( 'general.flavor_extra_specs') @@ -229,7 +230,7 @@ def create_flavor(nova_client, flavor_name, ram, disk, vcpus): return flavor.id -def get_or_create_flavor(flavor_name, ram, disk, vcpus): +def get_or_create_flavor(flavor_name, ram, disk, vcpus, public=True): flavor_exists = False nova_client = get_nova_client() @@ -240,7 +241,8 @@ def get_or_create_flavor(flavor_name, ram, disk, vcpus): else: logger.info("Creating flavor '%s' with '%s' RAM, '%s' disk size, " "'%s' vcpus..." % (flavor_name, ram, disk, vcpus)) - flavor_id = create_flavor(nova_client, flavor_name, ram, disk, vcpus) + flavor_id = create_flavor( + nova_client, flavor_name, ram, disk, vcpus, public=public) if not flavor_id: logger.error("Failed to create flavor '%s'..." % (flavor_name)) else: |