Run cinder-manage as correct user/group

We need to explicitly run cinder-manage with cinder user/group.
Running as root may cause files in /var/log/cinder/* to be owned by
root, and this will cause cinder services from being able to start (due
to being unable to write to files in that directory).

This is a non-issue when you install from packages as the package
post-install typically does a cinder-manage with the correct user, and
this ensures logs are created w/ correct ownership.

Change-Id: I50c94646a993ae5eb2e8775d979a4c0a73f2f4f2
This commit is contained in:
Matt Thompson 2014-05-09 14:59:58 +01:00
parent 85a7d6efd5
commit aa8d617808
2 changed files with 5 additions and 2 deletions

View File

@ -62,7 +62,10 @@ service_pass = get_password 'service', 'openstack-block-storage'
auth_uri = auth_uri_transform(identity_endpoint.to_s, node['openstack']['block-storage']['api']['auth']['version'])
execute 'cinder-manage db sync'
execute 'cinder-manage db sync' do
user node['openstack']['block-storage']['user']
group node['openstack']['block-storage']['group']
end
template '/etc/cinder/api-paste.ini' do
source 'api-paste.ini.erb'

View File

@ -49,7 +49,7 @@ describe 'openstack-block-storage::api' do
end
it 'runs db migrations' do
expect(chef_run).to run_execute('cinder-manage db sync')
expect(chef_run).to run_execute('cinder-manage db sync').with(user: 'cinder', group: 'cinder')
end
describe 'api-paste.ini' do