From 6069dc1656bc96557f4062708c9cb361cfff3b16 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 18 Jan 2021 20:47:32 +0900 Subject: [PATCH] Use $::os_service_defualt instead of redefining the same default This change removes the redundant re-definitions of default values about some parameters in scheduler, so that we can ensure the default values defined in nova itself is always used. Change-Id: Iad6de5a4ad75d206f407d3150876779da9993a88 --- manifests/scheduler/filter.pp | 18 +++++++++--------- spec/classes/nova_scheduler_filter_spec.rb | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/manifests/scheduler/filter.pp b/manifests/scheduler/filter.pp index 4b4669a7e..68ead26b5 100644 --- a/manifests/scheduler/filter.pp +++ b/manifests/scheduler/filter.pp @@ -6,11 +6,15 @@ # # [*scheduler_host_subset_size*] # (optional) defines the subset size that a host is chosen from -# Defaults to '1' +# Defaults to $::os_service_default # # [*max_io_ops_per_host*] # (optional) Ignore hosts that have too many builds/resizes/snaps/migrations -# Defaults to '8' +# Defaults to $::os_service_default +# +# [*max_instances_per_host*] +# (optional) Ignore hosts that have too many instances +# Defaults to $::os_service_default # # [*isolated_images*] # (optional) An array of images to run on isolated host @@ -20,10 +24,6 @@ # (optional) An array of hosts reserved for specific images # Defaults to $::os_service_default # -# [*max_instances_per_host*] -# (optional) Ignore hosts that have too many instances -# Defaults to '50' -# # [*scheduler_available_filters*] # (optional) An array with filter classes available to the scheduler. # Example: ['first.filter.class', 'second.filter.class'] @@ -114,9 +114,9 @@ # class nova::scheduler::filter ( - $scheduler_host_subset_size = '1', - $max_io_ops_per_host = '8', - $max_instances_per_host = '50', + $scheduler_host_subset_size = $::os_service_default, + $max_io_ops_per_host = $::os_service_default, + $max_instances_per_host = $::os_service_default, $isolated_images = $::os_service_default, $isolated_hosts = $::os_service_default, $scheduler_available_filters = ['nova.scheduler.filters.all_filters'], diff --git a/spec/classes/nova_scheduler_filter_spec.rb b/spec/classes/nova_scheduler_filter_spec.rb index 81263a2d5..095820973 100644 --- a/spec/classes/nova_scheduler_filter_spec.rb +++ b/spec/classes/nova_scheduler_filter_spec.rb @@ -9,9 +9,9 @@ describe 'nova::scheduler::filter' do shared_examples 'nova::scheduler::filter' do context 'with default parameters' do - it { is_expected.to contain_nova_config('filter_scheduler/host_subset_size').with_value('1') } - it { is_expected.to contain_nova_config('filter_scheduler/max_io_ops_per_host').with_value('8') } - it { is_expected.to contain_nova_config('filter_scheduler/max_instances_per_host').with_value('50') } + it { is_expected.to contain_nova_config('filter_scheduler/host_subset_size').with_value('') } + it { is_expected.to contain_nova_config('filter_scheduler/max_io_ops_per_host').with_value('') } + it { is_expected.to contain_nova_config('filter_scheduler/max_instances_per_host').with_value('') } it { is_expected.to contain_nova_config('filter_scheduler/available_filters').with_value(['nova.scheduler.filters.all_filters']) } it { is_expected.to contain_nova_config('filter_scheduler/weight_classes').with_value('nova.scheduler.weights.all_weighers') } it { is_expected.to contain_nova_config('filter_scheduler/isolated_images').with_value('') }