From 22c695f08a82d527668ef906e11089e6b0046a50 Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Wed, 11 May 2016 12:49:07 -0500 Subject: [PATCH] Have a way to disable Glance v1 in devstack As part of the process of deprecating Glance's V1, the glance team would like to start testing V2-only environments. Therefore, this change provides a way to force other services to use V2. Change-Id: I87e77d07964eac01e9a796817cbc88bd6e59c721 --- lib/cinder | 4 ++++ lib/glance | 7 +++++++ lib/tempest | 3 +++ 3 files changed, 14 insertions(+) diff --git a/lib/cinder b/lib/cinder index 17862327c4..7763599bae 100644 --- a/lib/cinder +++ b/lib/cinder @@ -342,6 +342,10 @@ function configure_cinder { iniset $CINDER_CONF DEFAULT glance_ca_certificates_file $SSL_BUNDLE_FILE fi + if [ "$GLANCE_V1_ENABLED" != "True" ]; then + iniset $CINDER_CONF DEFAULT glance_api_version 2 + fi + # Register SSL certificates if provided if is_ssl_enabled_service cinder; then ensure_certificates CINDER diff --git a/lib/glance b/lib/glance index cda357fa66..2ad971fed7 100644 --- a/lib/glance +++ b/lib/glance @@ -57,6 +57,7 @@ GLANCE_SCHEMA_JSON=$GLANCE_CONF_DIR/schema-image.json GLANCE_SWIFT_STORE_CONF=$GLANCE_CONF_DIR/glance-swift-store.conf GLANCE_GLARE_CONF=$GLANCE_CONF_DIR/glance-glare.conf GLANCE_GLARE_PASTE_INI=$GLANCE_CONF_DIR/glance-glare-paste.ini +GLANCE_V1_ENABLED=${GLANCE_V1_ENABLED:-True} if is_ssl_enabled_service "glance" || is_service_enabled tls-proxy; then GLANCE_SERVICE_PROTOCOL="https" @@ -134,6 +135,12 @@ function configure_glance { iniset $GLANCE_API_CONF DEFAULT disk_formats "ami,ari,aki,vhd,vmdk,raw,qcow2,vdi,iso,ploop" fi + # NOTE(flaper87): To uncomment as soon as all services consuming Glance are + # able to consume V2 entirely. + if [ "$GLANCE_V1_ENABLED" != "True" ]; then + iniset $GLANCE_API_CONF DEFAULT enable_v1_api False + fi + # Store specific configs iniset $GLANCE_API_CONF glance_store filesystem_store_datadir $GLANCE_IMAGE_DIR/ if is_service_enabled g-glare; then diff --git a/lib/tempest b/lib/tempest index e556935cb5..19042ef0c2 100644 --- a/lib/tempest +++ b/lib/tempest @@ -292,6 +292,9 @@ function configure_tempest { # Image Features iniset $TEMPEST_CONFIG image-feature-enabled deactivate_image True + if [ "$GLANCE_V1_ENABLED" != "True" ]; then + iniset $TEMPEST_CONFIG image-feature-enabled api_v1 False + fi # Compute iniset $TEMPEST_CONFIG compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED