Add attribute stores for glance-api.conf

Attribute name: stores
File name: /etc/glance/glance-api.conf
Section: glance_store

- known_stores is deprecated for stores option in Juno, update template
- Attribute for configuring stores does not exist, add it
- Spec test for stores attribute does not exist, update api-spec.rb
- Move default_store to [glance_store] section to meet definition

Change-Id: Ib3955e2efdff7f03c652d3438f43a98cbfe2c05e
This commit is contained in:
Alberto Gireud 2014-11-13 13:34:26 -06:00
parent 89a4514c6d
commit da01f920c4
5 changed files with 33 additions and 20 deletions

View File

@ -21,6 +21,7 @@ This file is used to list changes made in each version of cookbook-openstack-ima
* Add support for multiple rabbit mq hosts
* Make auth_version to be v2.0 in configuration file
* Set the default cinder version to be v2
* stores in glance-api.conf configurable with node attribute
## 9.2.0
* python_packages database client attributes have been migrated to the -common cookbook

View File

@ -134,6 +134,7 @@ Attributes for the Image service are in the ['openstack']['image'] namespace.
* `openstack['image']['upload_image']['<imagename>']` - URL location of the `<imagename>` image. There can be multiple instances of this line to define multiple imagess (eg natty, maverick, fedora17 etc)
--- example `openstack['image']['upload_image']['natty']` - "http://c250663.r63.cf1.rackcdn.com/ubuntu-11.04-server-uec-amd64-multinic.tar.gz"
* `openstack['image']['api']['default_store']` - Toggles the backend storage type. Currently supported is "file", "swift" and "rbd".
* `openstack['image']['api']['stores']` - List of which store classes and store class locations are currently known to glance at startup
* `openstack['image']['api']['block-storage']['cinder_catalog_info']` - Info to match when looking for cinder in the service catalog
* `openstack['image']['api']['block-storage']['cinder_api_insecure']` - Allow to perform insecure SSL requests to cinder (boolean value)
* `openstack['image']['api']['block-storage']['cinder_ca_certificates_file']` - Location of ca certicates file to use for cinder client requests

View File

@ -107,6 +107,8 @@ default['openstack']['image']['api']['caching'] = false
default['openstack']['image']['api']['cache_management'] = false
default['openstack']['image']['api']['default_store'] = 'file'
# List of which store classes and store class locations are currently known to glance at startup
default['openstack']['image']['api']['stores'] = ['file', 'http']
default['openstack']['image']['filesystem_store_datadir'] = '/var/lib/glance/images'
default['openstack']['image']['filesystem_store_metadata_file'] = nil

View File

@ -131,6 +131,15 @@ describe 'openstack-image::api' do
end
end
it 'uses default stores attribute' do
expect(chef_run).to render_file(file.name).with_content(/^stores = file, http$/)
end
it 'sets the stores attribute' do
node.set['openstack']['image']['api']['stores'] = ['swift']
expect(chef_run).to render_file(file.name).with_content(/^stores = swift$/)
end
it 'uses default filesystem_store_metadata_file attribute' do
expect(chef_run).not_to render_file(file.name).with_content(/^filesystem_store_metadata_file =/)
end

View File

@ -9,26 +9,6 @@ verbose = <%= node["openstack"]["image"]["verbose"] %>
#debug = False
debug = <%= node["openstack"]["image"]["debug"] %>
# Which backend scheme should Glance use by default is not specified
# in a request to add a new image to Glance? Known schemes are determined
# by the known_stores option below.
# Default: 'file'
default_store = <%= node["openstack"]["image"]["api"]["default_store"] %>
# List of which store classes and store class locations are
# currently known to glance at startup.
# Existing but disabled stores:
# glance.store.rbd.Store,
# glance.store.s3.Store,
# glance.store.swift.Store,
# glance.store.sheepdog.Store,
# glance.store.cinder.Store,
# glance.store.gridfs.Store,
# glance.store.vmware_datastore.Store,
#known_stores = glance.store.filesystem.Store,
# glance.store.http.Store
# Maximum image size (in bytes) that may be uploaded through the
# Glance API server. Defaults to 1 TB.
# WARNING: this value should only be increased after careful consideration
@ -320,6 +300,26 @@ qpid_topology_version=<%= node["openstack"]["mq"]["image"]["qpid"]["topology_ver
<% end %>
<% end %>
[glance_store]
# Which backend scheme should Glance use by default is not specified
# in a request to add a new image to Glance? Known schemes are determined
# by the stores option below.
# Default: 'file'
default_store = <%= node["openstack"]["image"]["api"]["default_store"] %>
# List of which store classes and store class locations are
# currently known to glance at startup.
# Existing but disabled stores:
# rbd,
# s3,
# swift,
# sheepdog,
# cinder,
# gridfs,
# vmware_datastore,
#stores = file, http
stores = <%= node["openstack"]["image"]["api"]["stores"].join(', ') %>
# ============ Filesystem Store Options ========================
# Directory that the Filesystem backend store