Check if advanced image flavor already exists

Flavor added in 79c679683d fails in
at least stable/wallaby neutron-ovn-tempest-slow job, as the flavor
already exists.

This checks if a flavor with this name already exists before trying to
create it

Change-Id: I624f53e39c4bcdd988900aca375ee5e4ddd445fe
Related-Bug: #1940243
This commit is contained in:
Bernard Cafarelli 2021-08-24 16:39:29 +02:00
parent e347cd2858
commit d30297b7d4
No known key found for this signature in database
GPG Key ID: D148244A3C2462BD

View File

@ -93,5 +93,7 @@ function create_flavor_for_advance_image {
local disk=$3
local vcpus=$4
openstack flavor create --ram $ram --disk $disk --vcpus $vcpus $name
if [[ -z $(openstack flavor list | grep $name) ]]; then
openstack flavor create --ram $ram --disk $disk --vcpus $vcpus $name
fi
}