ensure cinder volume_group sets the created volume
The openstack::cinder::storage class previously accepted a parameter called volume_group which was used to set the name of the volume group that cinder should use to create managed volumes. The same class also takes an argument called setup_test_volume that indicates if a test_volume should be created. The problem was that this test volume name was not being set as $volume_group, meaning that they would not match up if the user supplied a custom volume name. This patch resolves that issue, ensuring that volume groups are created with the correct name. Change-Id: Icbd43ec35b2cc008e5fa84e717fd5804fbe280d0
This commit is contained in:
@@ -42,7 +42,9 @@ class openstack::cinder::storage(
|
||||
volume_group => $volume_group,
|
||||
}
|
||||
if $setup_test_volume {
|
||||
class {'::cinder::setup_test_volume':}
|
||||
class {'::cinder::setup_test_volume':
|
||||
volume_name => $volume_group,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
warning("Unsupported volume driver: ${volume_driver}, make sure you are configuring this yourself")
|
||||
|
@@ -2,27 +2,22 @@ require 'spec_helper'
|
||||
|
||||
describe 'openstack::cinder::storage' do
|
||||
|
||||
|
||||
let :required_params do
|
||||
let :params do
|
||||
{
|
||||
:sql_connection => 'mysql://a:b:c:d',
|
||||
:rabbit_password => 'rabpass'
|
||||
}
|
||||
end
|
||||
|
||||
let :params do
|
||||
required_params
|
||||
end
|
||||
|
||||
let :facts do
|
||||
{ :osfamily => 'Redhat' }
|
||||
end
|
||||
|
||||
it 'should configure cinder and cinder::volume using defaults and required parameters' do
|
||||
should contain_class('cinder').with(
|
||||
:sql_connection => required_params[:sql_connection],
|
||||
:sql_connection => params[:sql_connection],
|
||||
:rabbit_userid => 'guest',
|
||||
:rabbit_password => required_params[:rabbit_password],
|
||||
:rabbit_password => params[:rabbit_password],
|
||||
:rabbit_host => '127.0.0.1',
|
||||
:rabbit_port => '5672',
|
||||
:rabbit_hosts => nil,
|
||||
@@ -43,8 +38,8 @@ describe 'openstack::cinder::storage' do
|
||||
end
|
||||
|
||||
describe 'with a volume driver other than iscsi' do
|
||||
let :params do
|
||||
required_params.merge(
|
||||
before do
|
||||
params.merge!(
|
||||
:volume_driver => 'netapp'
|
||||
)
|
||||
end
|
||||
@@ -52,12 +47,22 @@ describe 'openstack::cinder::storage' do
|
||||
end
|
||||
|
||||
describe 'when setting up test volumes for iscsi' do
|
||||
let :params do
|
||||
required_params.merge(
|
||||
:setup_test_volume => 'setup_test_volume'
|
||||
before do
|
||||
params.merge!(
|
||||
:setup_test_volume => true
|
||||
)
|
||||
end
|
||||
it { should contain_class('cinder::setup_test_volume') }
|
||||
it { should contain_class('cinder::setup_test_volume').with(
|
||||
:volume_name => 'cinder-volumes'
|
||||
)}
|
||||
describe 'when volume_group is set' do
|
||||
before do
|
||||
params.merge!(:volume_group => 'foo')
|
||||
end
|
||||
it { should contain_class('cinder::setup_test_volume').with(
|
||||
:volume_name => 'foo'
|
||||
)}
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user