Browse code

Enable certificate check for glance_store+swift

Disable insecure option for glance_store with
swift backend when tls is enabled.
Specify swift_store_cacert option.

Change-Id: Ia1e8f596c95dd7b6e63cb21a94c8316dc71bf945

Vladislav Kuzmin authored on 2020/05/20 17:14:04
Showing 1 changed files
... ...
@@ -212,25 +212,19 @@ function configure_glance {
212 212
     if is_service_enabled s-proxy; then
213 213
         iniset $GLANCE_API_CONF glance_store default_store swift
214 214
         iniset $GLANCE_API_CONF glance_store swift_store_create_container_on_put True
215
-        if python3_enabled; then
216
-            iniset $GLANCE_API_CONF glance_store swift_store_auth_insecure True
217
-        fi
218 215
 
219 216
         iniset $GLANCE_API_CONF glance_store swift_store_config_file $GLANCE_SWIFT_STORE_CONF
220 217
         iniset $GLANCE_API_CONF glance_store default_swift_reference ref1
221 218
         iniset $GLANCE_API_CONF glance_store stores "file, http, swift"
219
+        if is_service_enabled tls-proxy; then
220
+            iniset $GLANCE_API_CONF glance_store swift_store_cacert $SSL_BUNDLE_FILE
221
+        fi
222 222
         iniset $GLANCE_API_CONF DEFAULT graceful_shutdown_timeout "$SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT"
223 223
 
224 224
         iniset $GLANCE_SWIFT_STORE_CONF ref1 user $SERVICE_PROJECT_NAME:glance-swift
225 225
 
226 226
         iniset $GLANCE_SWIFT_STORE_CONF ref1 key $SERVICE_PASSWORD
227
-        if python3_enabled; then
228
-            # NOTE(dims): Currently the glance_store+swift does not support either an insecure flag
229
-            # or ability to specify the CACERT. So fallback to http:// url
230
-            iniset $GLANCE_SWIFT_STORE_CONF ref1 auth_address ${KEYSTONE_SERVICE_URI/https/http}/v3
231
-        else
232
-            iniset $GLANCE_SWIFT_STORE_CONF ref1 auth_address $KEYSTONE_SERVICE_URI/v3
233
-        fi
227
+        iniset $GLANCE_SWIFT_STORE_CONF ref1 auth_address $KEYSTONE_SERVICE_URI/v3
234 228
         iniset $GLANCE_SWIFT_STORE_CONF ref1 auth_version 3
235 229
     fi
236 230