Add support for misc options in cinder.conf

Add misc_cinder in cinder.conf like misc_nova.
Add test
Closes-Bug: #1314105
Change-Id: Ia23809e33dd1b64e276d373ce87355dbecf857e9
This commit is contained in:
shuozhang 2014-05-21 11:20:29 +08:00
parent 860a4ea53a
commit 8b2ee6face
6 changed files with 25 additions and 1 deletions

View File

@ -1,6 +1,10 @@
openstack-block-storage Cookbook CHANGELOG
==============================
This file is used to list changes made in each version of the openstack-block-storage cookbook.
## 9.2.2
### Bug
* Add support for miscellaneous options (like in Compute)
## 9.2.1
### Bug
* Remove output of extra config lines in cinder.conf.erb

View File

@ -120,6 +120,7 @@ Cinder attributes
* `openstack["block-storage"]["rpc_thread_pool_size"]` - Size of RPC thread pool
* `openstack["block-storage"]["rpc_conn_pool_size"]` - Size of RPC connection pool
* `openstack["block-storage"]["rpc_response_timeout"]` - Seconds to wait for a response from call or multicall
* `openstack["block-storage"]["misc_cinder"] - Array of strings to be added to cinder.conf for misc options, e.g. ['# Comment', 'key=value']
### Storwize/SVC attributes ###
* `openstack['block-storage']['san']['san_ip'] - IP address of SAN controller

View File

@ -222,6 +222,11 @@ default['openstack']['block-storage']['rbd_secret_uuid'] = nil
default['openstack']['block-storage']['rbd_secret_name'] = '00000000-0000-0000-0000-000000000000'
default['openstack']['block-storage']['rbd_key_name'] = 'openstack_image_cephx_key'
# Misc option support
# Allow additional strings to be added to cinder.conf
# For example: ['# Comment', 'key=value']
default['openstack']['block-storage']['misc_cinder'] = []
case platform_family
when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
# operating system user and group names

View File

@ -5,7 +5,7 @@ maintainer_email 'cookbooks@lists.tfoundry.com'
license 'Apache 2.0'
description 'The OpenStack Advanced Volume Management service Cinder.'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '9.2.1'
version '9.2.2'
recipe 'openstack-block-storage::api', 'Installs the cinder-api, sets up the cinder database, and cinder service/user/endpoints in keystone'
recipe 'openstack-block-storage::client', 'Install packages required for cinder client'

View File

@ -520,6 +520,14 @@ describe 'openstack-block-storage::cinder-common' do
node.set['openstack']['block-storage']['gpfs']['gpfs_images_dir'] = 'gpfs_images_dir_value'
expect(chef_run).to render_file(file.name).with_content(/^gpfs_images_dir = gpfs_images_dir_value$/)
end
it 'templates misc_cinder array correctly' do
node.set['openstack']['block-storage']['misc_cinder'] = ['# Comments', 'MISC=OPTION']
expect(chef_run).to render_file(file.name).with_content(
/^# Comments$/)
expect(chef_run).to render_file(file.name).with_content(
/^MISC=OPTION$/)
end
end
end
end

View File

@ -976,3 +976,9 @@ gpfs_sparse_volumes = <%= node['openstack']['block-storage']['gpfs']['gpfs_spars
gpfs_storage_pool = <%= node['openstack']['block-storage']['gpfs']['gpfs_storage_pool'] %>
<% end %>
# Misc options
<% if node["openstack"]["block-storage"]["misc_cinder"] %>
<% node["openstack"]["block-storage"]["misc_cinder"].each do |m| %>
<%= m %>
<% end %>
<% end %>