Browse code

Add external lock dir to glance api config

As we move to enabling glance-api to use a wsgi script that might be run
as multiple processes, there are a couple places where external
synchronization is necessary. To use this we need to set the lock_path
config option from oslo.concurrency so external locks will work.

Change-Id: I9a66a8636d12037ff9aa4fb73cc3f9b9343dd7e9

Matthew Treinish authored on 2017/04/25 14:30:10
Showing 1 changed files
... ...
@@ -43,6 +43,7 @@ fi
43 43
 
44 44
 GLANCE_CACHE_DIR=${GLANCE_CACHE_DIR:=$DATA_DIR/glance/cache}
45 45
 GLANCE_IMAGE_DIR=${GLANCE_IMAGE_DIR:=$DATA_DIR/glance/images}
46
+GLANCE_LOCK_DIR=${GLANCE_LOCK_DIR:=$DATA_DIR/glance/locks}
46 47
 GLANCE_AUTH_CACHE_DIR=${GLANCE_AUTH_CACHE_DIR:-/var/cache/glance}
47 48
 
48 49
 GLANCE_CONF_DIR=${GLANCE_CONF_DIR:-/etc/glance}
... ...
@@ -116,6 +117,7 @@ function configure_glance {
116 116
     iniset $GLANCE_API_CONF database connection $dburl
117 117
     iniset $GLANCE_API_CONF DEFAULT use_syslog $SYSLOG
118 118
     iniset $GLANCE_API_CONF DEFAULT image_cache_dir $GLANCE_CACHE_DIR/
119
+    iniset $GLANCE_API_CONF DEFAULT lock_path $GLANCE_LOCK_DIR
119 120
     iniset $GLANCE_API_CONF paste_deploy flavor keystone+cachemanagement
120 121
     configure_auth_token_middleware $GLANCE_API_CONF glance $GLANCE_AUTH_CACHE_DIR/api
121 122
     iniset $GLANCE_API_CONF oslo_messaging_notifications driver messagingv2