Browse code

Merge "Have a way to disable Glance v1 in devstack"

Jenkins authored on 2016/06/15 04:50:38
Showing 3 changed files
... ...
@@ -344,6 +344,10 @@ function configure_cinder {
344 344
         iniset $CINDER_CONF DEFAULT glance_ca_certificates_file $SSL_BUNDLE_FILE
345 345
     fi
346 346
 
347
+    if [ "$GLANCE_V1_ENABLED" != "True" ]; then
348
+        iniset $CINDER_CONF DEFAULT glance_api_version 2
349
+    fi
350
+
347 351
     # Register SSL certificates if provided
348 352
     if is_ssl_enabled_service cinder; then
349 353
         ensure_certificates CINDER
... ...
@@ -57,6 +57,7 @@ GLANCE_SCHEMA_JSON=$GLANCE_CONF_DIR/schema-image.json
57 57
 GLANCE_SWIFT_STORE_CONF=$GLANCE_CONF_DIR/glance-swift-store.conf
58 58
 GLANCE_GLARE_CONF=$GLANCE_CONF_DIR/glance-glare.conf
59 59
 GLANCE_GLARE_PASTE_INI=$GLANCE_CONF_DIR/glance-glare-paste.ini
60
+GLANCE_V1_ENABLED=${GLANCE_V1_ENABLED:-True}
60 61
 
61 62
 if is_ssl_enabled_service "glance" || is_service_enabled tls-proxy; then
62 63
     GLANCE_SERVICE_PROTOCOL="https"
... ...
@@ -134,6 +135,12 @@ function configure_glance {
134 134
         iniset $GLANCE_API_CONF DEFAULT disk_formats "ami,ari,aki,vhd,vmdk,raw,qcow2,vdi,iso,ploop"
135 135
     fi
136 136
 
137
+    # NOTE(flaper87): To uncomment as soon as all services consuming Glance are
138
+    # able to consume V2 entirely.
139
+    if [ "$GLANCE_V1_ENABLED" != "True" ]; then
140
+        iniset $GLANCE_API_CONF DEFAULT enable_v1_api False
141
+    fi
142
+
137 143
     # Store specific configs
138 144
     iniset $GLANCE_API_CONF glance_store filesystem_store_datadir $GLANCE_IMAGE_DIR/
139 145
     if is_service_enabled g-glare; then
... ...
@@ -296,6 +296,9 @@ function configure_tempest {
296 296
 
297 297
     # Image Features
298 298
     iniset $TEMPEST_CONFIG image-feature-enabled deactivate_image True
299
+    if [ "$GLANCE_V1_ENABLED" != "True" ]; then
300
+        iniset $TEMPEST_CONFIG image-feature-enabled api_v1 False
301
+    fi
299 302
 
300 303
     # Compute
301 304
     iniset $TEMPEST_CONFIG compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED