Creates an empty init script override file if necessary

Without this patch, puppet runs were failing with the following error:

(/Stage[main]/Cinder::Volume::Rbd/File_line[set initscript env]) Could not
evaluate: No such file or directory - /etc/init/cinder-volume.override

Change-Id: Ibf42b4b09441c8a044f50af62246be31fe584e1b
This commit is contained in:
Francois Deppierraz 2013-08-13 14:58:09 +02:00
parent c93e26a361
commit 7690d7c223
2 changed files with 14 additions and 0 deletions

View File

@ -52,6 +52,11 @@ class cinder::volume::rbd (
}
}
# Creates an empty file if it doesn't yet exist
file { $::cinder::params::ceph_init_override:
ensure => present,
}
file_line { 'set initscript env':
line => $override_line,
path => $::cinder::params::ceph_init_override,

View File

@ -30,6 +30,9 @@ describe 'cinder::volume::rbd' do
'test')
should contain_cinder_config('DEFAULT/rbd_secret_uuid').with_value(
'0123456789')
should contain_file('/etc/init/cinder-volume.override').with(
:ensure => 'present'
)
should contain_file_line('set initscript env').with(
:line => /env CEPH_ARGS=\"--id test\"/,
:path => '/etc/init/cinder-volume.override',
@ -47,6 +50,12 @@ describe 'cinder::volume::rbd' do
req_params
end
it 'should ensure that the cinder-volume sysconfig file is present' do
should contain_file('/etc/sysconfig/openstack-cinder-volume').with(
:ensure => 'present'
)
end
it 'should configure RedHat init override' do
should contain_file_line('set initscript env').with(
:line => /export CEPH_ARGS=\"--id test\"/,