From 4f99bd851e34c096790147bc462aa2dd2022eca6 Mon Sep 17 00:00:00 2001 From: Evgeny Sikachev Date: Tue, 14 Jun 2016 15:55:17 +0300 Subject: [PATCH] Migrate to openstackclient from glanceclient Migrate to openstackclient in dib and ui jobs Change-Id: I876aaa9f3d1158d5b87e7ce5ee2de9e6963bcad8 --- config/devstack/pre_unstack.sh | 32 ++++++++++++++++---------------- slave-scripts/functions-dib.sh | 11 +++++------ slave-scripts/gate-ui-tests.sh | 4 ++-- slave-scripts/tempest.sh | 2 +- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/config/devstack/pre_unstack.sh b/config/devstack/pre_unstack.sh index f49dbc5d..35d7cd43 100755 --- a/config/devstack/pre_unstack.sh +++ b/config/devstack/pre_unstack.sh @@ -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 diff --git a/slave-scripts/functions-dib.sh b/slave-scripts/functions-dib.sh index c882452a..0cdd7551 100755 --- a/slave-scripts/functions-dib.sh +++ b/slave-scripts/functions-dib.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() { diff --git a/slave-scripts/gate-ui-tests.sh b/slave-scripts/gate-ui-tests.sh index 1a8ca6c5..a70c804c 100755 --- a/slave-scripts/gate-ui-tests.sh +++ b/slave-scripts/gate-ui-tests.sh @@ -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 diff --git a/slave-scripts/tempest.sh b/slave-scripts/tempest.sh index 20dceebb..28667021 100755 --- a/slave-scripts/tempest.sh +++ b/slave-scripts/tempest.sh @@ -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