
When you execute nova-manage commands, oslo logs to the following location (file name is dynamically created based on command name). /var/log/nova/nova-manage.log Because puppet-nova is executing these commands as root, nova-manage.log is owned by root, preventing the 'nova-manage db archive_deleted_rows' entry in nova's crontab from executing. Permission denied: '/var/log/nova/nova-manage.log' This log file is also an outlier, as all other log files in /var/log/nova/ are owned by nova:nova. Similar issues are possible for other nova logs, if for example a nova services is initially started manually as root, so the ownership of all nova logs is corrected before configuring nova. Co-Authored-By: Oliver Walsh <owalsh@redhat.com> Co-Authored-By: Diana Clarke <diana.joan.clarke@gmail.com> Co-Authored-By: Maciej Kucia <maciej@kucia.net> Closes-Bug: #1671681 Change-Id: I0ca0110cbf9139c79074cf603dcab9135f96e765
61 lines
2.0 KiB
Ruby
61 lines
2.0 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'nova::cron::archive_deleted_rows' do
|
|
|
|
let :facts do
|
|
OSDefaults.get_facts({ :osfamily => 'Debian' })
|
|
end
|
|
|
|
let :params do
|
|
{ :minute => 1,
|
|
:hour => 0,
|
|
:monthday => '*',
|
|
:month => '*',
|
|
:weekday => '*',
|
|
:max_rows => '100',
|
|
:user => 'nova',
|
|
:until_complete => false,
|
|
:destination => '/var/log/nova/nova-rowsflush.log' }
|
|
end
|
|
|
|
context 'until_complete is false' do
|
|
it 'configures a cron without until_complete' do
|
|
is_expected.to contain_cron('nova-manage db archive_deleted_rows').with(
|
|
:command => "nova-manage db archive_deleted_rows --max_rows #{params[:max_rows]} >>#{params[:destination]} 2>&1",
|
|
:user => 'nova',
|
|
:environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
|
|
:user => params[:user],
|
|
:minute => params[:minute],
|
|
:hour => params[:hour],
|
|
:monthday => params[:monthday],
|
|
:month => params[:month],
|
|
:weekday => params[:weekday],
|
|
:require => 'Anchor[nova::dbsync::end]',
|
|
)
|
|
end
|
|
end
|
|
|
|
context 'until_complete is true' do
|
|
before :each do
|
|
params.merge!(
|
|
:until_complete => true,
|
|
)
|
|
end
|
|
|
|
it 'configures a cron with until_complete' do
|
|
is_expected.to contain_cron('nova-manage db archive_deleted_rows').with(
|
|
:command => "nova-manage db archive_deleted_rows --max_rows #{params[:max_rows]} --until_complete >>#{params[:destination]} 2>&1",
|
|
:user => 'nova',
|
|
:environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
|
|
:user => params[:user],
|
|
:minute => params[:minute],
|
|
:hour => params[:hour],
|
|
:monthday => params[:monthday],
|
|
:month => params[:month],
|
|
:weekday => params[:weekday],
|
|
:require => 'Anchor[nova::dbsync::end]',
|
|
)
|
|
end
|
|
end
|
|
end
|