26 |
26 |
27 from openstack_common import alter_mysql_tables, create_backups, modify_conf |
27 from openstack_common import alter_mysql_tables, create_backups, modify_conf |
28 |
28 |
29 |
29 |
30 GLANCE_API_MAPPINGS = { |
30 GLANCE_API_MAPPINGS = { |
31 # Deprecated group/name |
31 # Deprecated from Kilo to Mitaka |
32 ('DEFAULT', 'container_formats'): ('image_format', 'container_formats'), |
|
33 ('DEFAULT', 'disk_formats'): ('image_format', 'disk_formats'), |
|
34 ('DEFAULT', 'matchmaker_ringfile'): ('matchmaker_ring', 'ringfile'), |
|
35 ('DEFAULT', 'rabbit_durable_queues'): ('oslo_messaging_qpid', |
|
36 'amqp_durable_queues'), |
|
37 ('DEFAULT', 'qpid_hostname'): ('oslo_messaging_qpid', 'qpid_hostname'), |
|
38 ('DEFAULT', 'qpid_port'): ('oslo_messaging_qpid', 'qpid_port'), |
|
39 ('DEFAULT', 'qpid_username'): ('oslo_messaging_qpid', 'qpid_username'), |
|
40 ('DEFAULT', 'qpid_password'): ('oslo_messaging_qpid', 'qpid_password'), |
|
41 ('DEFAULT', 'qpid_sasl_mechanisms'): ('oslo_messaging_qpid', |
|
42 'qpid_sasl_mechanisms'), |
|
43 ('DEFAULT', 'qpid_heartbeat'): ('oslo_messaging_qpid', 'qpid_heartbeat'), |
|
44 ('DEFAULT', 'qpid_protocol'): ('oslo_messaging_qpid', 'qpid_protocol'), |
|
45 ('DEFAULT', 'qpid_tcp_nodelay'): ('oslo_messaging_qpid', |
|
46 'qpid_tcp_nodelay'), |
|
47 ('DEFAULT', 'rabbit_host'): ('oslo_messaging_rabbit', 'rabbit_host'), |
|
48 ('DEFAULT', 'rabbit_port'): ('oslo_messaging_rabbit', 'rabbit_port'), |
|
49 ('DEFAULT', 'rabbit_use_ssl'): ('oslo_messaging_rabbit', 'rabbit_use_ssl'), |
|
50 ('DEFAULT', 'rabbit_userid'): ('oslo_messaging_rabbit', 'rabbit_userid'), |
|
51 ('DEFAULT', 'rabbit_password'): ('oslo_messaging_rabbit', |
|
52 'rabbit_password'), |
|
53 ('DEFAULT', 'rabbit_virtual_host'): ('oslo_messaging_rabbit', |
|
54 'rabbit_virtual_host'), |
|
55 ('task', 'eventlet_executor_pool_size'): |
|
56 ('taskflow_executor', 'max_workers'), |
|
57 ('DEFAULT', 'log-format'): (None, None), |
|
58 ('DEFAULT', 'log_format'): (None, None), |
32 ('DEFAULT', 'log_format'): (None, None), |
59 ('DEFAULT', 'use-syslog'): (None, None), |
33 ('DEFAULT', 'use-syslog'): (None, None), |
60 ('glance_store', 'vmware_datacenter_path'): (None, None), |
34 ('DEFAULT', 'rpc_thread_pool_size'): |
61 ('glance_store', 'vmware_datastore_name'): (None, None), |
35 ('DEFAULT', 'executor_thread_pool_size'), |
|
36 ('DEFAULT', 'notification_driver'): |
|
37 ('oslo_messaging_notifications', 'driver'), |
|
38 ('DEFAULT', 'notification_topics'): |
|
39 ('oslo_messaging_notifications', 'topics'), |
|
40 ('glance_store', 'os_region_name'): |
|
41 ('glance_store', 'cinder_os_region_name'), |
|
42 ('keystone_authtoken', 'auth_plugin'): |
|
43 ('keystone_authtoken', 'auth_type'), |
|
44 ('DEFAULT', 'scrubber_datadir'): (None, None), |
|
45 ('DEFAULT', 'cleanup_scrubber'): (None, None), |
|
46 ('DEFAULT', 'cleanup_scrubber_time'): (None, None), |
|
47 ('DEFAULT', 'use_syslog_rfc_format'): (None, None), |
|
48 ('DEFAULT', 'rpc_zmq_port'): (None, None), |
|
49 ('DEFAULT', 'matchmaker_heartbeat_freq'): (None, None), |
|
50 ('DEFAULT', 'matchmaker_heartbeat_ttl'): (None, None), |
|
51 ('glance_store', 'mongodb_store_uri'): (None, None), |
|
52 ('glance_store', 'mongodb_store_db'): (None, None), |
62 } |
53 } |
63 |
54 |
64 GLANCE_API_EXCEPTIONS = [ |
55 GLANCE_API_EXCEPTIONS = [ |
65 ('DEFAULT', 'admin_tenant_name'), |
56 ('DEFAULT', 'admin_tenant_name'), |
66 ('DEFAULT', 'admin_user'), |
57 ('DEFAULT', 'admin_user'), |
123 ('oslo_messaging_qpid', 'qpid_heartbeat'), |
114 ('oslo_messaging_qpid', 'qpid_heartbeat'), |
124 ('oslo_messaging_qpid', 'qpid_protocol'), |
115 ('oslo_messaging_qpid', 'qpid_protocol'), |
125 ('oslo_messaging_qpid', 'qpid_tcp_nodelay'), |
116 ('oslo_messaging_qpid', 'qpid_tcp_nodelay'), |
126 ] |
117 ] |
127 |
118 |
|
119 GLANCE_CACHE_MAPPINGS = { |
|
120 # Deprecated group/name |
|
121 ('DEFAULT', 'log_format'): (None, None), |
|
122 ('DEFAULT', 'use-syslog'): (None, None), |
|
123 ('DEFAULT', 'use_syslog_rfc_format'): (None, None), |
|
124 } |
|
125 |
128 GLANCE_CACHE_EXCEPTIONS = [ |
126 GLANCE_CACHE_EXCEPTIONS = [ |
129 ('DEFAULT', 'log_file'), |
127 ('DEFAULT', 'log_file'), |
130 ('DEFAULT', 'image_cache_dir'), |
128 ('DEFAULT', 'image_cache_dir'), |
131 ('DEFAULT', 'image_cache_stall_time'), |
129 ('DEFAULT', 'image_cache_stall_time'), |
132 ('DEFAULT', 'image_cache_max_size'), |
130 ('DEFAULT', 'image_cache_max_size'), |
138 ('DEFAULT', 'admin_password'), |
136 ('DEFAULT', 'admin_password'), |
139 ('DEFAULT', 'filesystem_store_datadir'), |
137 ('DEFAULT', 'filesystem_store_datadir'), |
140 ] |
138 ] |
141 |
139 |
142 GLANCE_REGISTRY_MAPPINGS = { |
140 GLANCE_REGISTRY_MAPPINGS = { |
143 # Deprecate group/name |
141 # Deprecated group/name |
144 ('DEFAULT', 'rabbit_durable_queues'): ('oslo_messaging_qpid', |
142 ('DEFAULT', 'log_format'): (None, None), |
145 'rabbit_durable_queues'), |
143 ('DEFAULT', 'use-syslog'): (None, None), |
146 ('DEFAULT', 'qpid_hostname'): ('oslo_messaging_qpid', 'qpid_hostname'), |
144 ('DEFAULT', 'rpc_zmq_port'): (None, None), |
147 ('DEFAULT', 'qpid_port'): ('oslo_messaging_qpid', 'qpid_port'), |
145 ('DEFAULT', 'matchmaker_heartbeat_freq'): (None, None), |
148 ('DEFAULT', 'qpid_username'): ('oslo_messaging_qpid', 'qpid_username'), |
146 ('DEFAULT', 'matchmaker_heartbeat_ttl'): (None, None), |
149 ('DEFAULT', 'qpid_password'): ('oslo_messaging_qpid', 'qpid_password'), |
147 ('DEFAULT', 'rpc_thread_pool_size'): |
150 ('DEFAULT', 'qpid_sasl_mechanisms'): ('oslo_messaging_qpid', |
148 ('DEFAULT', 'executor_thread_pool_size'), |
151 'qpid_sasl_mechanisms'), |
149 ('DEFAULT', 'notification_driver'): |
152 ('DEFAULT', 'qpid_heartbeat'): ('oslo_messaging_qpid', 'qpid_heartbeat'), |
150 ('oslo_messaging_notifications', 'driver'), |
153 ('DEFAULT', 'qpid_protocol'): ('oslo_messaging_qpid', 'qpid_protocol'), |
151 ('DEFAULT', 'notification_topics'): |
154 ('DEFAULT', 'qpid_tcp_nodelay'): ('oslo_messaging_qpid', |
152 ('oslo_messaging_notifications', 'topics'), |
155 'qpid_tcp_nodelay'), |
153 ('glance_store', 'mongodb_store_uri'): (None, None), |
156 ('DEFAULT', 'rabbit_host'): ('oslo_messaging_rabbit', 'rabbit_host'), |
154 ('glance_store', 'mongodb_store_db'): (None, None), |
157 ('DEFAULT', 'rabbit_port'): ('oslo_messaging_rabbit', 'rabbit_port'), |
155 ('glance_store', 'os_region_name'): |
158 ('DEFAULT', 'rabbit_use_ssl'): ('oslo_messaging_rabbit', 'rabbit_use_ssl'), |
156 ('glance_store', 'cinder_os_region_name'), |
159 ('DEFAULT', 'rabbit_userid'): ('oslo_messaging_rabbit', 'rabbit_userid'), |
157 ('keystone_authtoken', 'auth_plugin'): |
160 ('DEFAULT', 'rabbit_password'): ('oslo_messaging_rabbit', |
158 ('keystone_authtoken', 'auth_type'), |
161 'rabbit_password'), |
|
162 ('DEFAULT', 'rabbit_virtual_host'): ('oslo_messaging_rabbit', |
|
163 'rabbit_virtual_host'), |
|
164 } |
159 } |
165 |
160 |
166 GLANCE_REGISTRY_EXCEPTIONS = [ |
161 GLANCE_REGISTRY_EXCEPTIONS = [ |
167 ('DEFAULT', 'bind_host'), |
162 ('DEFAULT', 'bind_host'), |
168 ('DEFAULT', 'bind_port'), |
163 ('DEFAULT', 'bind_port'), |
202 ('oslo_messaging_qpid', 'qpid_protocol'), |
197 ('oslo_messaging_qpid', 'qpid_protocol'), |
203 ('oslo_messaging_qpid', 'qpid_tcp_nodelay'), |
198 ('oslo_messaging_qpid', 'qpid_tcp_nodelay'), |
204 ('paste_deploy', 'flavor'), |
199 ('paste_deploy', 'flavor'), |
205 ] |
200 ] |
206 |
201 |
207 # TODO: Add mappings? |
202 GLANCE_SCRUBBER_MAPPINGS = { |
208 # GLANCE_SCRUBBER_MAPPINGS |
203 # Deprecated group/name |
|
204 ('DEFAULT', 'log_format'): (None, None), |
|
205 ('DEFAULT', 'use_syslog_rfc_format'): (None, None), |
|
206 } |
209 |
207 |
210 GLANCE_SCRUBBER_EXCEPTIONS = [ |
208 GLANCE_SCRUBBER_EXCEPTIONS = [ |
211 ('DEFAULT', 'log_file'), |
209 ('DEFAULT', 'log_file'), |
212 ('DEFAULT', 'wakeup_time'), |
210 ('DEFAULT', 'wakeup_time'), |
213 ('DEFAULT', 'scrubber_datadir'), |
211 ('DEFAULT', 'scrubber_datadir'), |
250 create_backups('/etc/glance') |
248 create_backups('/etc/glance') |
251 |
249 |
252 modify_conf('/etc/glance/glance-api.conf', GLANCE_API_MAPPINGS, |
250 modify_conf('/etc/glance/glance-api.conf', GLANCE_API_MAPPINGS, |
253 GLANCE_API_EXCEPTIONS) |
251 GLANCE_API_EXCEPTIONS) |
254 modify_conf('/etc/glance/glance-api-paste.ini') |
252 modify_conf('/etc/glance/glance-api-paste.ini') |
255 modify_conf('/etc/glance/glance-cache.conf', |
253 modify_conf('/etc/glance/glance-cache.conf', GLANCE_CACHE_MAPPINGS, |
256 exception_list=GLANCE_CACHE_EXCEPTIONS) |
254 GLANCE_CACHE_EXCEPTIONS) |
257 modify_conf('/etc/glance/glance-registry.conf', |
255 modify_conf('/etc/glance/glance-registry.conf', |
258 GLANCE_REGISTRY_MAPPINGS, |
256 GLANCE_REGISTRY_MAPPINGS, |
259 exception_list=GLANCE_REGISTRY_EXCEPTIONS) |
257 exception_list=GLANCE_REGISTRY_EXCEPTIONS) |
260 modify_conf('/etc/glance/glance-registry-paste.ini') |
258 modify_conf('/etc/glance/glance-registry-paste.ini') |
261 modify_conf('/etc/glance/glance-scrubber.conf', |
259 modify_conf('/etc/glance/glance-scrubber.conf', |
262 exception_list=GLANCE_SCRUBBER_EXCEPTIONS) |
260 GLANCE_SCRUBBER_MAPPINGS, GLANCE_SCRUBBER_EXCEPTIONS) |
263 |
261 |
264 config = iniparse.RawConfigParser() |
262 config = iniparse.RawConfigParser() |
265 config.read('/etc/glance/glance-api.conf') |
263 config.read('/etc/glance/glance-api.conf') |
266 # In certain cases the database section does not exist and the |
264 # In certain cases the database section does not exist and the |
267 # default database chosen is sqlite. |
265 # default database chosen is sqlite. |