deb-sahara/tools/gate/scenario/commons
Vitaly Gridnev 4408e837b4 Use explicit version of image client in gates
DevStack uses v2 version for openstack image client, but
this version doesn't support --property as well.
So, let's use v1 version for registering image for Sahara.

Closes-bug: 1499309
Change-Id: Iec6aa6b42e5575690631fed585eaa8d6ff2501a1
2015-09-24 13:00:18 +00:00

49 lines
1.5 KiB
Bash

#!/bin/bash
#
# Copyright (c) 2015 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
export NETWORK=${1:-neutron}
export ENGINE=${2:-heat}
# Normalize network name
if [[ $NETWORK == nova* ]]; then
export NETWORK="nova-network"
fi
source settings
export DEST=${DEST:-$BASE/new}
export DEVSTACK_DIR=${DEVSTACK_DIR:-$DEST/devstack}
export SAHARA_DIR=${SAHARA_DIR:-$DEST/sahara}
export LOCALRC_PATH=$DEVSTACK_DIR/localrc
export LOCALCONF_PATH=$DEVSTACK_DIR/local.conf
function sahara_register_fake_plugin_image {
local props="--public"
props+=" --property _sahara_tag_0.1=True"
props+=" --property _sahara_tag_fake=True"
props+=" --property _sahara_username=$SAHARA_FAKE_PLUGIN_IMAGE_USERNAME"
openstack --os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT --os-image-api-version 1 image set \
$SAHARA_FAKE_PLUGIN_IMAGE_NAME $props
}
function sahara_register_flavor {
nova flavor-create $SAHARA_FLAVOR_NAME $SAHARA_FLAVOR_ID $SAHARA_FLAVOR_RAM \
$SAHARA_FLAVOR_DISK $SAHARA_FLAVOR_VCPUS
}