Browse code

Clean up Glance config files

The current Glance config files are a combination of copied and
generated files. This patch makes all the files generated and
removes now unnecssary ini(un)comment statements. It additionally
removes some ini(un)comment statements that weren't having any
effect on the previously generated files.

Change-Id: I6e4b7694e8bebb7fe6661ead034ee257c768e342

Brian Rosmaita authored on 2017/12/12 08:07:50
Showing 1 changed files
... ...
@@ -110,11 +110,9 @@ function configure_glance {
110 110
     # Server is configured through this function and not init_glance.
111 111
     create_glance_cache_dir
112 112
 
113
-    # Copy over our glance configurations and update them
114
-    cp $GLANCE_DIR/etc/glance-registry.conf $GLANCE_REGISTRY_CONF
113
+    # Set non-default configuration options for registry
115 114
     iniset $GLANCE_REGISTRY_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
116 115
     iniset $GLANCE_REGISTRY_CONF DEFAULT bind_host $GLANCE_SERVICE_LISTEN_ADDRESS
117
-    inicomment $GLANCE_REGISTRY_CONF DEFAULT log_file
118 116
     local dburl
119 117
     dburl=`database_connection_url glance`
120 118
     iniset $GLANCE_REGISTRY_CONF database connection $dburl
... ...
@@ -125,8 +123,8 @@ function configure_glance {
125 125
     iniset_rpc_backend glance $GLANCE_REGISTRY_CONF
126 126
     iniset $GLANCE_REGISTRY_CONF DEFAULT graceful_shutdown_timeout "$SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT"
127 127
 
128
+    # Set non-default configuration options for the API server
128 129
     iniset $GLANCE_API_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
129
-    inicomment $GLANCE_API_CONF DEFAULT log_file
130 130
     iniset $GLANCE_API_CONF database connection $dburl
131 131
     iniset $GLANCE_API_CONF DEFAULT use_syslog $SYSLOG
132 132
     iniset $GLANCE_API_CONF DEFAULT image_cache_dir $GLANCE_CACHE_DIR/
... ...
@@ -184,11 +182,6 @@ function configure_glance {
184 184
             iniset $GLANCE_SWIFT_STORE_CONF ref1 auth_address $KEYSTONE_SERVICE_URI/v3
185 185
         fi
186 186
         iniset $GLANCE_SWIFT_STORE_CONF ref1 auth_version 3
187
-
188
-        # commenting is not strictly necessary but it's confusing to have bad values in conf
189
-        inicomment $GLANCE_API_CONF glance_store swift_store_user
190
-        inicomment $GLANCE_API_CONF glance_store swift_store_key
191
-        inicomment $GLANCE_API_CONF glance_store swift_store_auth_address
192 187
     fi
193 188
 
194 189
     # We need to tell glance what it's public endpoint is so that the version
... ...
@@ -214,18 +207,13 @@ function configure_glance {
214 214
     cp -p $GLANCE_DIR/etc/glance-registry-paste.ini $GLANCE_REGISTRY_PASTE_INI
215 215
     cp -p $GLANCE_DIR/etc/glance-api-paste.ini $GLANCE_API_PASTE_INI
216 216
 
217
-    cp $GLANCE_DIR/etc/glance-cache.conf $GLANCE_CACHE_CONF
217
+    # Set non-default configuration options for the glance-cache
218 218
     iniset $GLANCE_CACHE_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
219
-    inicomment $GLANCE_CACHE_CONF DEFAULT log_file
220 219
     iniset $GLANCE_CACHE_CONF DEFAULT use_syslog $SYSLOG
221 220
     iniset $GLANCE_CACHE_CONF DEFAULT image_cache_dir $GLANCE_CACHE_DIR/
222
-    iniuncomment $GLANCE_CACHE_CONF DEFAULT auth_url
223 221
     iniset $GLANCE_CACHE_CONF DEFAULT auth_url $KEYSTONE_AUTH_URI
224
-    iniuncomment $GLANCE_CACHE_CONF DEFAULT auth_tenant_name
225 222
     iniset $GLANCE_CACHE_CONF DEFAULT admin_tenant_name $SERVICE_PROJECT_NAME
226
-    iniuncomment $GLANCE_CACHE_CONF DEFAULT auth_user
227 223
     iniset $GLANCE_CACHE_CONF DEFAULT admin_user glance
228
-    iniuncomment $GLANCE_CACHE_CONF DEFAULT auth_password
229 224
     iniset $GLANCE_CACHE_CONF DEFAULT admin_password $SERVICE_PASSWORD
230 225
     iniset $GLANCE_CACHE_CONF DEFAULT registry_host $GLANCE_SERVICE_HOST
231 226