Do not put empty default_volume_type into config

Change I1bb94dc1283e50645e4aece600acc52ae17db56b added the config option
default_volume_type with a default value of nil. With this, cinder fails
to create volumes unless a type is explicitly specified. So better only
write this value into the config file if it is set to some non-nil
value.

Change-Id: I7de8c6cc5a424b5b5021675d89a5dba71d72dce0
This commit is contained in:
Jens Rosenboom 2015-08-18 15:13:12 +02:00
parent 7f980745eb
commit ea2fbba04a
2 changed files with 3 additions and 1 deletions

View File

@ -1052,7 +1052,7 @@ describe 'openstack-block-storage::cinder-common' do
end
it 'does not set default_volume_type' do
expect(chef_run).to_not render_file(file.name).with_content(/^default_volume_type=.+$/)
expect(chef_run).to_not render_file(file.name).with_content(/^default_volume_type=.*$/)
end
end
end

View File

@ -586,8 +586,10 @@ volume_driver=<%= node["openstack"]["block-storage"]["volume"]["driver"] %>
# volume_force_update_capabilities=false
#### (BoolOpt) if True will force update capabilities on each check
<% if node["openstack"]["block-storage"]["volume"]["default_volume_type"] %>
# Default volume type to use (string value)
default_volume_type=<%= node["openstack"]["block-storage"]["volume"]["default_volume_type"] %>
<% end %>
######## defined in cinder.volume.netapp ########