Remove unnecessary class dependencies

Some classes require nova::compute::libvirt but there is no need to
put that class into dependencies because resource orders are defined
by deps or explicit definitions. Also, the base libvirt class is not
really required.

This change removes these dependencies, to avoid enforcing orders as
much as possible.

Change-Id: Icbb2fa209effd355cef36f35662bfdcf18d8b090
This commit is contained in:
Takashi Kajinami 2022-06-25 23:38:02 +09:00
parent 6849e6dec7
commit e192c9c789
18 changed files with 1 additions and 92 deletions

View File

@ -60,7 +60,6 @@ class nova::compute::libvirt::qemu(
) inherits nova::compute::libvirt::version { ) inherits nova::compute::libvirt::version {
include nova::deps include nova::deps
require nova::compute::libvirt
if versioncmp($libvirt_version, '4.5') < 0 { if versioncmp($libvirt_version, '4.5') < 0 {
fail('libvirt version < 4.5 is no longer supported') fail('libvirt version < 4.5 is no longer supported')

View File

@ -47,7 +47,6 @@ class nova::compute::libvirt::virtlockd (
) { ) {
include nova::deps include nova::deps
require nova::compute::libvirt
virtlockd_config { virtlockd_config {
'log_level': value => pick($log_level, $::os_service_default); 'log_level': value => pick($log_level, $::os_service_default);
@ -58,8 +57,4 @@ class nova::compute::libvirt::virtlockd (
'max_size': value => pick($max_size, $::os_service_default); 'max_size': value => pick($max_size, $::os_service_default);
'max_backups': value => pick($max_backups, $::os_service_default); 'max_backups': value => pick($max_backups, $::os_service_default);
} }
Anchor['nova::config::begin']
-> Virtlockd_config<||>
-> Anchor['nova::config::end']
} }

View File

@ -47,7 +47,6 @@ class nova::compute::libvirt::virtlogd (
) { ) {
include nova::deps include nova::deps
require nova::compute::libvirt
virtlogd_config { virtlogd_config {
'log_level': value => pick($log_level, $::os_service_default); 'log_level': value => pick($log_level, $::os_service_default);

View File

@ -42,7 +42,6 @@ class nova::compute::libvirt::virtnodedevd (
) { ) {
include nova::deps include nova::deps
require nova::compute::libvirt
virtnodedevd_config { virtnodedevd_config {
'log_level': value => $log_level; 'log_level': value => $log_level;

View File

@ -50,7 +50,6 @@ class nova::compute::libvirt::virtproxyd (
) { ) {
include nova::deps include nova::deps
require nova::compute::libvirt
virtproxyd_config { virtproxyd_config {
'log_level': value => $log_level; 'log_level': value => $log_level;

View File

@ -43,7 +43,6 @@ class nova::compute::libvirt::virtqemud (
) { ) {
include nova::deps include nova::deps
require nova::compute::libvirt
virtqemud_config { virtqemud_config {
'log_level': value => $log_level; 'log_level': value => $log_level;

View File

@ -42,7 +42,6 @@ class nova::compute::libvirt::virtsecretd (
) { ) {
include nova::deps include nova::deps
require nova::compute::libvirt
virtsecretd_config { virtsecretd_config {
'log_level': value => $log_level; 'log_level': value => $log_level;

View File

@ -30,7 +30,6 @@ class nova::compute::libvirt::virtstoraged (
) { ) {
include nova::deps include nova::deps
require nova::compute::libvirt
virtstoraged_config { virtstoraged_config {
'log_level': value => $log_level; 'log_level': value => $log_level;

View File

@ -66,6 +66,7 @@ class nova::deps {
# Manage libvirt configurations during the config phase # Manage libvirt configurations during the config phase
Anchor['nova::config::begin'] -> Libvirtd_config<||> -> Anchor['nova::config::end'] Anchor['nova::config::begin'] -> Libvirtd_config<||> -> Anchor['nova::config::end']
Anchor['nova::config::begin'] -> Virtlogd_config<||> -> Anchor['nova::config::end'] Anchor['nova::config::begin'] -> Virtlogd_config<||> -> Anchor['nova::config::end']
Anchor['nova::config::begin'] -> Virtlockd_config<||> -> Anchor['nova::config::end']
Anchor['nova::config::begin'] -> Virtnodedevd_config<||> -> Anchor['nova::config::end'] Anchor['nova::config::begin'] -> Virtnodedevd_config<||> -> Anchor['nova::config::end']
Anchor['nova::config::begin'] -> Virtproxyd_config<||> -> Anchor['nova::config::end'] Anchor['nova::config::begin'] -> Virtproxyd_config<||> -> Anchor['nova::config::end']
Anchor['nova::config::begin'] -> Virtqemud_config<||> -> Anchor['nova::config::end'] Anchor['nova::config::begin'] -> Virtqemud_config<||> -> Anchor['nova::config::end']

View File

@ -2,10 +2,6 @@ require 'spec_helper'
require 'puppet/util/package' require 'puppet/util/package'
describe 'nova::compute::libvirt_guests' do describe 'nova::compute::libvirt_guests' do
let :pre_condition do
"include nova\ninclude nova::compute"
end
shared_examples 'redhat-nova-compute-libvirt-guests' do shared_examples 'redhat-nova-compute-libvirt-guests' do
context 'with default parameters' do context 'with default parameters' do

View File

@ -2,12 +2,6 @@ require 'spec_helper'
describe 'nova::compute::libvirt::qemu' do describe 'nova::compute::libvirt::qemu' do
let :pre_condition do
'include nova
include nova::compute
include nova::compute::libvirt'
end
shared_examples_for 'nova compute libvirt with qemu' do shared_examples_for 'nova compute libvirt with qemu' do
context 'when not configuring qemu' do context 'when not configuring qemu' do

View File

@ -4,14 +4,6 @@ require 'spec_helper'
describe 'nova::compute::libvirt::virtlockd' do describe 'nova::compute::libvirt::virtlockd' do
let :pre_condition do
<<-eos
include nova
include nova::compute
include nova::compute::libvirt
eos
end
shared_examples_for 'nova-compute-libvirt-virtlockd' do shared_examples_for 'nova-compute-libvirt-virtlockd' do
context 'with default parameters' do context 'with default parameters' do
@ -20,7 +12,6 @@ eos
end end
it { is_expected.to contain_class('nova::deps')} it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtlockd')}
it { is_expected.to contain_virtlockd_config('log_level').with_value('<SERVICE DEFAULT>')} it { is_expected.to contain_virtlockd_config('log_level').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_virtlockd_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)} it { is_expected.to contain_virtlockd_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)}
@ -42,7 +33,6 @@ eos
end end
it { is_expected.to contain_class('nova::deps')} it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtlockd')}
it { is_expected.to contain_virtlockd_config('log_level').with_value(params[:log_level])} it { is_expected.to contain_virtlockd_config('log_level').with_value(params[:log_level])}
it { is_expected.to contain_virtlockd_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)} it { is_expected.to contain_virtlockd_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)}

View File

@ -4,14 +4,6 @@ require 'spec_helper'
describe 'nova::compute::libvirt::virtlogd' do describe 'nova::compute::libvirt::virtlogd' do
let :pre_condition do
<<-eos
include nova
include nova::compute
include nova::compute::libvirt
eos
end
shared_examples_for 'nova-compute-libvirt-virtlogd' do shared_examples_for 'nova-compute-libvirt-virtlogd' do
context 'with default parameters' do context 'with default parameters' do
@ -20,7 +12,6 @@ eos
end end
it { is_expected.to contain_class('nova::deps')} it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtlogd')}
it { is_expected.to contain_virtlogd_config('log_level').with_value('<SERVICE DEFAULT>')} it { is_expected.to contain_virtlogd_config('log_level').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_virtlogd_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)} it { is_expected.to contain_virtlogd_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)}
@ -44,7 +35,6 @@ eos
end end
it { is_expected.to contain_class('nova::deps')} it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtlogd')}
it { is_expected.to contain_virtlogd_config('log_level').with_value(params[:log_level])} it { is_expected.to contain_virtlogd_config('log_level').with_value(params[:log_level])}
it { is_expected.to contain_virtlogd_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)} it { is_expected.to contain_virtlogd_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)}

View File

@ -4,14 +4,6 @@ require 'spec_helper'
describe 'nova::compute::libvirt::virtnodedevd' do describe 'nova::compute::libvirt::virtnodedevd' do
let :pre_condition do
<<-eos
include nova
include nova::compute
include nova::compute::libvirt
eos
end
shared_examples_for 'nova-compute-libvirt-virtnodedevd' do shared_examples_for 'nova-compute-libvirt-virtnodedevd' do
context 'with default parameters' do context 'with default parameters' do
@ -20,7 +12,6 @@ eos
end end
it { is_expected.to contain_class('nova::deps')} it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtnodedevd')}
it { is_expected.to contain_virtnodedevd_config('log_level').with_value('<SERVICE DEFAULT>')} it { is_expected.to contain_virtnodedevd_config('log_level').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_virtnodedevd_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)} it { is_expected.to contain_virtnodedevd_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)}
@ -42,7 +33,6 @@ eos
end end
it { is_expected.to contain_class('nova::deps')} it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtnodedevd')}
it { is_expected.to contain_virtnodedevd_config('log_level').with_value(params[:log_level])} it { is_expected.to contain_virtnodedevd_config('log_level').with_value(params[:log_level])}
it { is_expected.to contain_virtnodedevd_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)} it { is_expected.to contain_virtnodedevd_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)}

View File

@ -4,14 +4,6 @@ require 'spec_helper'
describe 'nova::compute::libvirt::virtproxyd' do describe 'nova::compute::libvirt::virtproxyd' do
let :pre_condition do
<<-eos
include nova
include nova::compute
include nova::compute::libvirt
eos
end
shared_examples_for 'nova-compute-libvirt-virtproxyd' do shared_examples_for 'nova-compute-libvirt-virtproxyd' do
context 'with default parameters' do context 'with default parameters' do
@ -20,7 +12,6 @@ eos
end end
it { is_expected.to contain_class('nova::deps')} it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtproxyd')}
it { is_expected.to contain_virtproxyd_config('log_level').with_value('<SERVICE DEFAULT>')} it { is_expected.to contain_virtproxyd_config('log_level').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_virtproxyd_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)} it { is_expected.to contain_virtproxyd_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)}
@ -44,7 +35,6 @@ eos
end end
it { is_expected.to contain_class('nova::deps')} it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtproxyd')}
it { is_expected.to contain_virtproxyd_config('log_level').with_value(params[:log_level])} it { is_expected.to contain_virtproxyd_config('log_level').with_value(params[:log_level])}
it { is_expected.to contain_virtproxyd_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)} it { is_expected.to contain_virtproxyd_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)}

View File

@ -4,14 +4,6 @@ require 'spec_helper'
describe 'nova::compute::libvirt::virtqemud' do describe 'nova::compute::libvirt::virtqemud' do
let :pre_condition do
<<-eos
include nova
include nova::compute
include nova::compute::libvirt
eos
end
shared_examples_for 'nova-compute-libvirt-virtqemud' do shared_examples_for 'nova-compute-libvirt-virtqemud' do
context 'with default parameters' do context 'with default parameters' do
@ -20,7 +12,6 @@ eos
end end
it { is_expected.to contain_class('nova::deps')} it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtqemud')}
it { is_expected.to contain_virtqemud_config('log_level').with_value('<SERVICE DEFAULT>')} it { is_expected.to contain_virtqemud_config('log_level').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_virtqemud_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)} it { is_expected.to contain_virtqemud_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)}
@ -42,7 +33,6 @@ eos
end end
it { is_expected.to contain_class('nova::deps')} it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtqemud')}
it { is_expected.to contain_virtqemud_config('log_level').with_value(params[:log_level])} it { is_expected.to contain_virtqemud_config('log_level').with_value(params[:log_level])}
it { is_expected.to contain_virtqemud_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)} it { is_expected.to contain_virtqemud_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)}

View File

@ -4,14 +4,6 @@ require 'spec_helper'
describe 'nova::compute::libvirt::virtsecretd' do describe 'nova::compute::libvirt::virtsecretd' do
let :pre_condition do
<<-eos
include nova
include nova::compute
include nova::compute::libvirt
eos
end
shared_examples_for 'nova-compute-libvirt-virtsecretd' do shared_examples_for 'nova-compute-libvirt-virtsecretd' do
context 'with default parameters' do context 'with default parameters' do
@ -20,7 +12,6 @@ eos
end end
it { is_expected.to contain_class('nova::deps')} it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtsecretd')}
it { is_expected.to contain_virtsecretd_config('log_level').with_value('<SERVICE DEFAULT>')} it { is_expected.to contain_virtsecretd_config('log_level').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_virtsecretd_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)} it { is_expected.to contain_virtsecretd_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)}
@ -42,7 +33,6 @@ eos
end end
it { is_expected.to contain_class('nova::deps')} it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtsecretd')}
it { is_expected.to contain_virtsecretd_config('log_level').with_value(params[:log_level])} it { is_expected.to contain_virtsecretd_config('log_level').with_value(params[:log_level])}
it { is_expected.to contain_virtsecretd_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)} it { is_expected.to contain_virtsecretd_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)}

View File

@ -4,14 +4,6 @@ require 'spec_helper'
describe 'nova::compute::libvirt::virtstoraged' do describe 'nova::compute::libvirt::virtstoraged' do
let :pre_condition do
<<-eos
include nova
include nova::compute
include nova::compute::libvirt
eos
end
shared_examples_for 'nova-compute-libvirt-virtstoraged' do shared_examples_for 'nova-compute-libvirt-virtstoraged' do
context 'with default parameters' do context 'with default parameters' do
@ -20,7 +12,6 @@ eos
end end
it { is_expected.to contain_class('nova::deps')} it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtstoraged')}
it { is_expected.to contain_virtstoraged_config('log_level').with_value('<SERVICE DEFAULT>')} it { is_expected.to contain_virtstoraged_config('log_level').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_virtstoraged_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)} it { is_expected.to contain_virtstoraged_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)}
@ -38,7 +29,6 @@ eos
end end
it { is_expected.to contain_class('nova::deps')} it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtstoraged')}
it { is_expected.to contain_virtstoraged_config('log_level').with_value(params[:log_level])} it { is_expected.to contain_virtstoraged_config('log_level').with_value(params[:log_level])}
it { is_expected.to contain_virtstoraged_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)} it { is_expected.to contain_virtstoraged_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)}