Make enable v1 and v2 api option configurable

Change-Id: I40efdc8c31dc38f214cc300cc68279af1b614089
Closes-Bug: #1452730
This commit is contained in:
Lan Qi song 2015-05-07 21:37:59 +08:00
parent b4ae9f3dec
commit 2ea252646d
4 changed files with 21 additions and 4 deletions

View File

@ -142,6 +142,8 @@ Cinder attributes
* `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']
* `openstack["block-storage"]["enable_v1_api"]` - Whether to enable cinder v1 api or not.
* `openstack["block-storage"]["enable_v2_api"]` - Whether to enable cinder v2 api or not.
### Storwize/SVC attributes ###
* `openstack['block-storage']['san']['san_ip'] - IP address of SAN controller

View File

@ -322,6 +322,12 @@ default['openstack']['block-storage']['misc_cinder'] = []
default['openstack']['block-storage']['lock_path'] =
"#{node['openstack']['block-storage']['volume']['state_path']}/lock"
# Whether to enable cinder v1 api or not
default['openstack']['block-storage']['enable_v1_api'] = 'False'
# Whether to enable cinder v2 api or not
default['openstack']['block-storage']['enable_v2_api'] = 'True'
case platform_family
when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
# operating system user and group names

View File

@ -341,8 +341,17 @@ describe 'openstack-block-storage::cinder-common' do
end
it 'has default api version set' do
[/^enable_v1_api=false$/,
/^enable_v2_api=true$/].each do |line|
[/^enable_v1_api=False$/,
/^enable_v2_api=True$/].each do |line|
expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', line)
end
end
it 'has override api version set' do
node.set['openstack']['block-storage']['enable_v1_api'] = 'True'
node.set['openstack']['block-storage']['enable_v2_api'] = 'False'
[/^enable_v1_api=True$/,
/^enable_v2_api=False$/].each do |line|
expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', line)
end
end

View File

@ -53,10 +53,10 @@ log_file = /var/log/cinder/cinder.log
#### (StrOpt) File name for the paste.deploy config for cinder-api
# DEPRECATED: Deploy v1 of the Cinder API. (boolean value)
enable_v1_api=false
enable_v1_api=<%= node["openstack"]["block-storage"]["enable_v1_api"] %>
# Deploy v2 of the Cinder API. (boolean value)
enable_v2_api=true
enable_v2_api=<%= node["openstack"]["block-storage"]["enable_v2_api"] %>
# pybasedir=/usr/lib/python/site-packages
#### (StrOpt) Directory where the cinder python module is installed