Migrate to openstackclient from glanceclient
Migrate to openstackclient in dib and ui jobs Change-Id: I876aaa9f3d1158d5b87e7ce5ee2de9e6963bcad8
This commit is contained in:
parent
520d9eaf61
commit
4f99bd851e
@ -12,7 +12,7 @@ else
|
||||
fi
|
||||
|
||||
get_id() {
|
||||
result=$(glance image-list | grep $(basename -s .qcow2 $1) | awk '{print $2}')
|
||||
result=$(openstack image list | grep $(basename -s .qcow2 $1) | awk '{print $2}')
|
||||
echo $result
|
||||
}
|
||||
|
||||
@ -33,21 +33,21 @@ MAPR_5_0_0_MRV2_IMAGE_PATH=/home/ubuntu/images/mapr_5.0.0.mrv2_u14.qcow2
|
||||
MAPR_5_1_0_MRV2_IMAGE_PATH=/home/ubuntu/images/mapr_5.1.0.mrv2_u14.qcow2
|
||||
|
||||
|
||||
glance image-download --file $VANILLA_2_6_0_IMAGE_PATH $(get_id $VANILLA_2_6_0_IMAGE_PATH)
|
||||
glance image-download --file $VANILLA_2_7_1_IMAGE_PATH $(get_id $VANILLA_2_7_1_IMAGE_PATH)
|
||||
glance image-download --file $AMBARI_2_3_IMAGE_PATH $(get_id $AMBARI_2_3_IMAGE_PATH)
|
||||
glance image-download --file $AMBARI_2_4_IMAGE_PATH $(get_id $AMBARI_2_4_IMAGE_PATH)
|
||||
glance image-download --file $CENTOS_CDH_5_3_0_IMAGE_PATH $(get_id $CENTOS_CDH_5_3_0_IMAGE_PATH)
|
||||
glance image-download --file $UBUNTU_CDH_5_3_0_IMAGE_PATH $(get_id $UBUNTU_CDH_5_3_0_IMAGE_PATH)
|
||||
glance image-download --file $UBUNTU_CDH_5_4_0_IMAGE_PATH $(get_id $UBUNTU_CDH_5_4_0_IMAGE_PATH)
|
||||
glance image-download --file $CENTOS_CDH_5_4_0_IMAGE_PATH $(get_id $CENTOS_CDH_5_4_0_IMAGE_PATH)
|
||||
glance image-download --file $UBUNTU_CDH_5_5_0_IMAGE_PATH $(get_id $UBUNTU_CDH_5_5_0_IMAGE_PATH)
|
||||
glance image-download --file $CENTOS_CDH_5_5_0_IMAGE_PATH $(get_id $CENTOS_CDH_5_5_0_IMAGE_PATH)
|
||||
glance image-download --file $SPARK_1_0_0_IMAGE_PATH $(get_id $SPARK_1_0_0_IMAGE_PATH)
|
||||
glance image-download --file $SPARK_1_3_1_IMAGE_PATH $(get_id $SPARK_1_3_1_IMAGE_PATH)
|
||||
glance image-download --file $SPARK_1_6_0_IMAGE_PATH $(get_id $SPARK_1_6_0_IMAGE_PATH)
|
||||
glance image-download --file $MAPR_5_0_0_MRV2_IMAGE_PATH $(get_id $MAPR_5_0_0_MRV2_IMAGE_PATH)
|
||||
glance image-download --file $MAPR_5_1_0_MRV2_IMAGE_PATH $(get_id $MAPR_5_1_0_MRV2_IMAGE_PATH)
|
||||
openstack image save --file $VANILLA_2_6_0_IMAGE_PATH $(get_id $VANILLA_2_6_0_IMAGE_PATH)
|
||||
openstack image save --file $VANILLA_2_7_1_IMAGE_PATH $(get_id $VANILLA_2_7_1_IMAGE_PATH)
|
||||
openstack image save --file $AMBARI_2_3_IMAGE_PATH $(get_id $AMBARI_2_3_IMAGE_PATH)
|
||||
openstack image save --file $AMBARI_2_4_IMAGE_PATH $(get_id $AMBARI_2_4_IMAGE_PATH)
|
||||
openstack image save --file $CENTOS_CDH_5_3_0_IMAGE_PATH $(get_id $CENTOS_CDH_5_3_0_IMAGE_PATH)
|
||||
openstack image save --file $UBUNTU_CDH_5_3_0_IMAGE_PATH $(get_id $UBUNTU_CDH_5_3_0_IMAGE_PATH)
|
||||
openstack image save --file $UBUNTU_CDH_5_4_0_IMAGE_PATH $(get_id $UBUNTU_CDH_5_4_0_IMAGE_PATH)
|
||||
openstack image save --file $CENTOS_CDH_5_4_0_IMAGE_PATH $(get_id $CENTOS_CDH_5_4_0_IMAGE_PATH)
|
||||
openstack image save --file $UBUNTU_CDH_5_5_0_IMAGE_PATH $(get_id $UBUNTU_CDH_5_5_0_IMAGE_PATH)
|
||||
openstack image save --file $CENTOS_CDH_5_5_0_IMAGE_PATH $(get_id $CENTOS_CDH_5_5_0_IMAGE_PATH)
|
||||
openstack image save --file $SPARK_1_0_0_IMAGE_PATH $(get_id $SPARK_1_0_0_IMAGE_PATH)
|
||||
openstack image save --file $SPARK_1_3_1_IMAGE_PATH $(get_id $SPARK_1_3_1_IMAGE_PATH)
|
||||
openstack image save --file $SPARK_1_6_0_IMAGE_PATH $(get_id $SPARK_1_6_0_IMAGE_PATH)
|
||||
openstack image save --file $MAPR_5_0_0_MRV2_IMAGE_PATH $(get_id $MAPR_5_0_0_MRV2_IMAGE_PATH)
|
||||
openstack image save --file $MAPR_5_1_0_MRV2_IMAGE_PATH $(get_id $MAPR_5_1_0_MRV2_IMAGE_PATH)
|
||||
|
||||
bash $TOP_DIR/unstack.sh
|
||||
|
||||
|
@ -21,9 +21,9 @@ cleanup_image() {
|
||||
}
|
||||
|
||||
delete_image() {
|
||||
id=$(glance image-list | grep -w $1 | awk '{print $2}')
|
||||
id=$(openstack image list | grep -w $1 | awk '{print $2}')
|
||||
if [ -n "$id" ]; then
|
||||
glance image-delete $id
|
||||
openstack image delete $id
|
||||
fi
|
||||
}
|
||||
|
||||
@ -38,14 +38,13 @@ failure() {
|
||||
register_new_image() {
|
||||
local image_name=$1
|
||||
local image_properties=$2
|
||||
glance image-create --name $image_name --file $image_name.qcow2 --disk-format qcow2 --container-format bare --property '_sahara_tag_ci'='True' $image_properties
|
||||
openstack dmage create $image_name --file $image_name.qcow2 --disk-format qcow2 --container-format bare --property '_sahara_tag_ci'='True' $image_properties
|
||||
}
|
||||
|
||||
rename_image() {
|
||||
# 1 - source image, 2 - target image
|
||||
id=$(glance image-list | grep -w $1 | awk '{print $2}')
|
||||
# Use v2 API Glance version as workaround for #1173044
|
||||
glance --debug --os-image-api-version 2 image-update "$id" --name $2
|
||||
id=$(openstack image list | grep -w $1 | awk '{print $2}')
|
||||
openstack image set "$id" --name $2
|
||||
}
|
||||
|
||||
upload_image() {
|
||||
|
@ -34,7 +34,7 @@ sudo service apache2 restart
|
||||
sleep 5
|
||||
|
||||
TEST_IMAGE=uitests-$RANDOM
|
||||
glance image-create --name $TEST_IMAGE --disk-format qcow2 --container-format bare < /proc/uptime
|
||||
openstack image create $TEST_IMAGE --disk-format qcow2 --container-format bare < /proc/uptime
|
||||
|
||||
echo "
|
||||
[common]
|
||||
@ -60,5 +60,5 @@ base_image = 'sahara-itests-ci-vanilla-image'
|
||||
cd $DASHBOARD_PATH && tox -e uitests
|
||||
STATUS=$?
|
||||
|
||||
glance image-delete $TEST_IMAGE
|
||||
openstack image delete $TEST_IMAGE
|
||||
exit $STATUS
|
||||
|
@ -6,7 +6,7 @@
|
||||
. $FUNCTION_PATH/functions-common.sh
|
||||
|
||||
project=$(echo $JOB_NAME | awk -F '-' '{ print $2 }')
|
||||
image_id=$(glance image-list | grep ubuntu-test-image | awk '{print $2}')
|
||||
image_id=$(openstack image list | grep ubuntu-test-image | awk '{print $2}')
|
||||
|
||||
SAHARATESTS_REPO=https://git.openstack.org/openstack/sahara-tests
|
||||
if [ "$project" == "sahara" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user