From ea2fbba04a53cc38201a5db92491dc4d45150aac Mon Sep 17 00:00:00 2001 From: Jens Rosenboom Date: Tue, 18 Aug 2015 15:13:12 +0200 Subject: [PATCH] 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 --- spec/cinder_common_spec.rb | 2 +- templates/default/cinder.conf.erb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb index 08b6025..dacc1e0 100644 --- a/spec/cinder_common_spec.rb +++ b/spec/cinder_common_spec.rb @@ -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 diff --git a/templates/default/cinder.conf.erb b/templates/default/cinder.conf.erb index 26847e2..e66c2cc 100644 --- a/templates/default/cinder.conf.erb +++ b/templates/default/cinder.conf.erb @@ -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 ########