Browse Source

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
Jens Rosenboom 3 years ago
parent
commit
ea2fbba04a
2 changed files with 3 additions and 1 deletions
  1. 1
    1
      spec/cinder_common_spec.rb
  2. 2
    0
      templates/default/cinder.conf.erb

+ 1
- 1
spec/cinder_common_spec.rb View File

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

+ 2
- 0
templates/default/cinder.conf.erb View File

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

Loading…
Cancel
Save