From 936838c5843f8b6b0be740f7a09946407a79aa48 Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Fri, 6 Nov 2020 16:19:11 +0100 Subject: [PATCH] Fix libvirt version discovery for CentOS Stream CentOS Stream is Rolling-release distro that tracks just ahead of Red Hat Enterprise Linux (RHEL) development [1]. While not recommended in RDO, it's used to find potential issues before they are found in official CentOS 8. CentOS Stream is reported by facter as '8' with no minor version, breaking the logic to discover the libvirtd version. This patch is setting the version of libvirtd to 5.6 for all CdentOS 8 releases, including Stream, as 8.0 is no longer supported. [1] https://www.centos.org/centos-stream/ Change-Id: I468ecf06ac6e0853fbb296c011f20d63e38f6922 (cherry picked from commit b6294ce7a27379444ec9a447a51a6a1f83e9069f) (squash) Do not test nova::migration::libvirt in 2 places Currently behavior of the nova::migration::libvirt class is tested in nova_migration_livirt_spec.rb, thus we don't need to test the same in nova_compute_libvirt_spec.rb. This patch also remove a redundant test case. Change-Id: Iec8f2986e165ccf60f4248cbf91aa8ce20e83a53 (cherry picked from commit 2b046eeec6e064c7189d13e699e92cce0ef386b9) --- manifests/compute/libvirt/version.pp | 2 +- spec/classes/nova_compute_libvirt_spec.rb | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/manifests/compute/libvirt/version.pp b/manifests/compute/libvirt/version.pp index b3c0240de..e23b47bfd 100644 --- a/manifests/compute/libvirt/version.pp +++ b/manifests/compute/libvirt/version.pp @@ -11,7 +11,7 @@ class nova::compute::libvirt::version { 'RedHat': { case $facts['os']['name'] { 'RedHat', 'CentOS': { - if versioncmp($facts['os']['release']['full'], '8.1') >= 0 { + if versioncmp($facts['os']['release']['full'], '8') >= 0 { $default = '5.6' } elsif versioncmp($facts['os']['release']['full'], '7.6') >= 0 { $default = '4.5' diff --git a/spec/classes/nova_compute_libvirt_spec.rb b/spec/classes/nova_compute_libvirt_spec.rb index 13d50c4c9..cb7a59b3d 100644 --- a/spec/classes/nova_compute_libvirt_spec.rb +++ b/spec/classes/nova_compute_libvirt_spec.rb @@ -216,7 +216,6 @@ describe 'nova::compute::libvirt' do it { is_expected.to contain_class('nova::migration::libvirt')} it { is_expected.to contain_nova_config('vnc/server_listen').with_value('0.0.0.0')} - it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(:line => libvirt_options) } end context 'with vncserver_listen set to ::0' do @@ -227,17 +226,6 @@ describe 'nova::compute::libvirt' do it { is_expected.to contain_class('nova::migration::libvirt')} it { is_expected.to contain_nova_config('vnc/server_listen').with_value('::0')} - it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(:line => libvirt_options) } - end - - context 'with custom libvirt service name on Debian platforms' do - let :params do - { :libvirt_service_name => 'libvirtd', - :vncserver_listen => '0.0.0.0', - :migration_support => true } - end - it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(:line => libvirt_options) } - end end @@ -348,7 +336,6 @@ describe 'nova::compute::libvirt' do it { is_expected.to contain_class('nova::migration::libvirt')} it { is_expected.to contain_nova_config('vnc/server_listen').with_value('0.0.0.0')} - it { is_expected.to contain_file_line('/etc/sysconfig/libvirtd libvirtd args').with(:line => 'LIBVIRTD_ARGS="--listen"') } end context 'with vncserver_listen set to ::0' do @@ -359,7 +346,6 @@ describe 'nova::compute::libvirt' do it { is_expected.to contain_class('nova::migration::libvirt')} it { is_expected.to contain_nova_config('vnc/server_listen').with_value('::0')} - it { is_expected.to contain_file_line('/etc/sysconfig/libvirtd libvirtd args').with(:line => 'LIBVIRTD_ARGS="--listen"') } end end