Create mount point directory when use multi backend configuration

Currently, when we use GPFSDriver as multi backend volume driver,
cookbook won't create gpfs mount point base directory automatically.

This patch fix this problem.

Closes-Bug: #1476960

Change-Id: I1faf33470747fac6df66854470cf45d35a38f3c1
This commit is contained in:
Lan Qi song 2015-07-22 15:21:28 +08:00
parent 5140ba531d
commit 7f980745eb
2 changed files with 37 additions and 0 deletions

View File

@ -141,6 +141,19 @@ when 'cinder.volume.drivers.ibm.gpfs.GPFSDriver'
group node['openstack']['block-storage']['group']
recursive true
end
multi_backend = node['openstack']['block-storage']['volume']['multi_backend']
unless multi_backend.nil?
multi_backend.each do |_drv, options|
options.select { |optkey, _optvalue| optkey == 'gpfs_mount_point_base' }.each do |_optkey, optvalue|
directory optvalue do
mode '0755'
owner node['openstack']['block-storage']['user']
group node['openstack']['block-storage']['group']
recursive true
end
end
end
end
when 'cinder.volume.drivers.ibm.ibmnas.IBMNAS_NFSDriver'
directory node['openstack']['block-storage']['ibmnas']['mount_point_base'] do

View File

@ -110,6 +110,17 @@ describe 'openstack-block-storage::volume' do
@chef_run = ::ChefSpec::SoloRunner.new ::REDHAT_OPTS do |n|
n.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.ibm.gpfs.GPFSDriver'
n.set['openstack']['block-storage']['gpfs']['gpfs_mount_point_base'] = 'volumes'
n.set['openstack']['block-storage']['volume']['multi_backend'] =
{
'gpfs01' => {
'gpfs_mount_point_base' => 'gpfs_volume01',
'volume_driver' => 'cinder.volume.drivers.ibm.gpfs.GPFSDriver'
},
'gpfs02' => {
'gpfs_mount_point_base' => 'gpfs_volume02',
'volume_driver' => 'cinder.volume.drivers.ibm.gpfs.GPFSDriver'
}
}
end
@conf = '/etc/cinder/cinder.conf'
@ -160,6 +171,19 @@ describe 'openstack-block-storage::volume' do
mode: '0755'
)
end
it 'verifies mount point base is created in multi backend case' do
expect(@chef_run).to create_directory('gpfs_volume01').with(
owner: 'cinder',
group: 'cinder',
mode: '0755'
)
expect(@chef_run).to create_directory('gpfs_volume02').with(
owner: 'cinder',
group: 'cinder',
mode: '0755'
)
end
end
describe 'create_vg' do