Browse code

Set configs for glance_store

glance_store uses a new section to keep its configs. This patch
duplicates the existing, store related, config options and sets them
under the glance_store section.

Once glance is fully migrated, the old options will be removed.

Change-Id: Ie3de87cf07a321415d111e644ccbb360c7491151

Flavio Percoco authored on 2014/09/03 18:51:00
Showing 1 changed files
... ...
@@ -102,7 +102,6 @@ function configure_glance {
102 102
     inicomment $GLANCE_API_CONF DEFAULT log_file
103 103
     iniset $GLANCE_API_CONF DEFAULT sql_connection $dburl
104 104
     iniset $GLANCE_API_CONF DEFAULT use_syslog $SYSLOG
105
-    iniset $GLANCE_API_CONF DEFAULT filesystem_store_datadir $GLANCE_IMAGE_DIR/
106 105
     iniset $GLANCE_API_CONF DEFAULT image_cache_dir $GLANCE_CACHE_DIR/
107 106
     iniset $GLANCE_API_CONF paste_deploy flavor keystone+cachemanagement
108 107
     iniset $GLANCE_API_CONF keystone_authtoken identity_uri $KEYSTONE_AUTH_URI
... ...
@@ -121,6 +120,13 @@ function configure_glance {
121 121
         iniset $GLANCE_API_CONF DEFAULT disk_formats "ami,ari,aki,vhd,raw,iso"
122 122
     fi
123 123
 
124
+    # Store specific configs
125
+    iniset $GLANCE_API_CONF DEFAULT filesystem_store_datadir $GLANCE_IMAGE_DIR/
126
+
127
+    # NOTE(flaper87): Until Glance is fully migrated, set these configs in both
128
+    # sections.
129
+    iniset $GLANCE_API_CONF glance_store filesystem_store_datadir $GLANCE_IMAGE_DIR/
130
+
124 131
     # Store the images in swift if enabled.
125 132
     if is_service_enabled s-proxy; then
126 133
         iniset $GLANCE_API_CONF DEFAULT default_store swift
... ...
@@ -130,6 +136,15 @@ function configure_glance {
130 130
         iniset $GLANCE_API_CONF DEFAULT swift_store_create_container_on_put True
131 131
 
132 132
         iniset $GLANCE_API_CONF DEFAULT known_stores "glance.store.filesystem.Store, glance.store.http.Store, glance.store.swift.Store"
133
+
134
+        # NOTE(flaper87): Until Glance is fully migrated, set these configs in both
135
+        # sections.
136
+        iniset $GLANCE_API_CONF glance_store default_store swift
137
+        iniset $GLANCE_API_CONF glance_store swift_store_auth_address $KEYSTONE_SERVICE_URI/v2.0/
138
+        iniset $GLANCE_API_CONF glance_store swift_store_user $SERVICE_TENANT_NAME:glance-swift
139
+        iniset $GLANCE_API_CONF glance_store swift_store_key $SERVICE_PASSWORD
140
+        iniset $GLANCE_API_CONF glance_store swift_store_create_container_on_put True
141
+        iniset $GLANCE_API_CONF glance_store stores "file, http, swift"
133 142
     fi
134 143
 
135 144
     cp -p $GLANCE_DIR/etc/glance-registry-paste.ini $GLANCE_REGISTRY_PASTE_INI
... ...
@@ -140,7 +155,6 @@ function configure_glance {
140 140
     iniset $GLANCE_CACHE_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
141 141
     inicomment $GLANCE_CACHE_CONF DEFAULT log_file
142 142
     iniset $GLANCE_CACHE_CONF DEFAULT use_syslog $SYSLOG
143
-    iniset $GLANCE_CACHE_CONF DEFAULT filesystem_store_datadir $GLANCE_IMAGE_DIR/
144 143
     iniset $GLANCE_CACHE_CONF DEFAULT image_cache_dir $GLANCE_CACHE_DIR/
145 144
     iniuncomment $GLANCE_CACHE_CONF DEFAULT auth_url
146 145
     iniset $GLANCE_CACHE_CONF DEFAULT auth_url $KEYSTONE_AUTH_URI/v2.0
... ...
@@ -151,6 +165,12 @@ function configure_glance {
151 151
     iniuncomment $GLANCE_CACHE_CONF DEFAULT auth_password
152 152
     iniset $GLANCE_CACHE_CONF DEFAULT admin_password $SERVICE_PASSWORD
153 153
 
154
+    # Store specific confs
155
+    # NOTE(flaper87): Until Glance is fully migrated, set these configs in both
156
+    # sections.
157
+    iniset $GLANCE_CACHE_CONF DEFAULT filesystem_store_datadir $GLANCE_IMAGE_DIR/
158
+    iniset $GLANCE_CACHE_CONF glance_store filesystem_store_datadir $GLANCE_IMAGE_DIR/
159
+
154 160
     cp -p $GLANCE_DIR/etc/policy.json $GLANCE_POLICY_JSON
155 161
     cp -p $GLANCE_DIR/etc/schema-image.json $GLANCE_SCHEMA_JSON
156 162
 }