From aa8d61780875e209addd1fe3f91483e381178e1e Mon Sep 17 00:00:00 2001 From: Matt Thompson Date: Fri, 9 May 2014 14:59:58 +0100 Subject: [PATCH] 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 --- recipes/api.rb | 5 ++++- spec/api_spec.rb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/recipes/api.rb b/recipes/api.rb index ee48403..9bb7176 100644 --- a/recipes/api.rb +++ b/recipes/api.rb @@ -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' diff --git a/spec/api_spec.rb b/spec/api_spec.rb index 792fefd..9b5739c 100644 --- a/spec/api_spec.rb +++ b/spec/api_spec.rb @@ -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