Fix libvirtd option

Some old code for Ubuntu 14.04 was adding the -d flag to libvirtd in
Debian, leading to libvirtd not being able to restart. This fixes it by
simply removing the old code for Ubuntu 14.04 support, and leaving a
single case where we want only the -l flag to libvirtd.

Change-Id: I2b84881e7405794b2464945cad9a9be641a31af7
This commit is contained in:
Thomas Goirand 2018-05-15 18:57:24 +02:00
parent 0486a25b1d
commit 3b69d99f82
3 changed files with 3 additions and 15 deletions

View File

@ -221,17 +221,9 @@ class nova::migration::libvirt(
'Debian': {
if $transport_real != 'ssh' {
if $::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemmajrelease, '16') >= 0 {
# If systemd is being used then libvirtd is already being launched correctly and
# adding -d causes a second consecutive start to fail which causes puppet to fail.
$libvirtd_opts = 'libvirtd_opts="-l"'
} else {
$libvirtd_opts = 'libvirtd_opts="-d -l"'
}
file_line { "/etc/default/${::nova::compute::libvirt::libvirt_service_name} libvirtd opts":
path => "/etc/default/${::nova::compute::libvirt::libvirt_service_name}",
line => $libvirtd_opts,
line => 'libvirtd_opts="-l"',
match => 'libvirtd_opts=',
tag => 'libvirt-file_line',
}

View File

@ -8,11 +8,7 @@ describe 'nova::compute::libvirt' do
shared_examples 'debian-nova-compute-libvirt' do
let(:libvirt_options) do
if facts[:operatingsystem] == 'Ubuntu' and Puppet::Util::Package.versioncmp(facts[:operatingsystemmajrelease], '16') >= 0
'libvirtd_opts="-l"'
else
'libvirtd_opts="-d -l"'
end
'libvirtd_opts="-l"'
end
describe 'with default parameters' do

View File

@ -253,7 +253,7 @@ describe 'nova::migration::libvirt' do
end
it_configures 'nova migration with libvirt'
it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(:line => 'libvirtd_opts="-d -l"') }
it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(:line => 'libvirtd_opts="-l"') }
end
context 'on RedHat platforms' do