From 490a34a7b2b2ef3038123b3e88672846ed64c7da Mon Sep 17 00:00:00 2001 From: David Vallee Delisle Date: Wed, 2 Dec 2020 14:54:50 -0500 Subject: [PATCH] Removing scheduler_default_filters This setting was renamed enabled_filters a while back. For the sake of consistency, we need to change this here as well. Another change in THT will follow this one. Change-Id: I110f612f1b78899e8969da607e6b400e2e64c8a1 --- manifests/scheduler/filter.pp | 28 ++++++++++++++----- ...uler_default_filters-79cade007780030f.yaml | 6 ++++ spec/classes/nova_scheduler_filter_spec.rb | 4 +-- 3 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 releasenotes/notes/deprecate_scheduler_default_filters-79cade007780030f.yaml diff --git a/manifests/scheduler/filter.pp b/manifests/scheduler/filter.pp index c957ab6be..4b4669a7e 100644 --- a/manifests/scheduler/filter.pp +++ b/manifests/scheduler/filter.pp @@ -29,7 +29,7 @@ # Example: ['first.filter.class', 'second.filter.class'] # Defaults to ['nova.scheduler.filters.all_filters'] # -# [*scheduler_default_filters*] +# [*scheduler_enabled_filters*] # (optional) An array of filters to be used by default # Defaults to $::os_service_default # @@ -108,6 +108,11 @@ # determined by the particular scheduler being used. # Defaults to undef # +# [*scheduler_default_filters*] +# (optional) An array of filters to be used by default +# Defaults to $::os_service_default +# + class nova::scheduler::filter ( $scheduler_host_subset_size = '1', $max_io_ops_per_host = '8', @@ -115,7 +120,7 @@ class nova::scheduler::filter ( $isolated_images = $::os_service_default, $isolated_hosts = $::os_service_default, $scheduler_available_filters = ['nova.scheduler.filters.all_filters'], - $scheduler_default_filters = $::os_service_default, + $scheduler_enabled_filters = $::os_service_default, $scheduler_weight_classes = 'nova.scheduler.weights.all_weighers', $track_instance_changes = $::os_service_default, $ram_weight_multiplier = $::os_service_default, @@ -133,6 +138,7 @@ class nova::scheduler::filter ( # DEPRECATED PARAMETERS $scheduler_max_attempts = undef, $periodic_task_interval = undef, + $scheduler_default_filters = undef, ) { include nova::deps @@ -147,15 +153,23 @@ will be removed in a future release. Use the nova::scheduler::max_attempts param will be removed in a future release. Use the nova::scheduler::periodic_task_interval parameter instead.') } +if $scheduler_default_filters != undef { + warning('The nova::scheduler::filter::scheduler_default_filters parameter has been deprecated and \ +will be removed in a future release. Use the nova::scheduler::schedumer_enabled_filters parameter instead.') + } + + # The following values are following this rule: # - default is $::os_service_default so Puppet won't try to configure it. # - if set, we'll validate it's an array that is not empty and configure the parameter. # - Otherwise, fallback to default. - if !is_service_default($scheduler_default_filters) and !empty($scheduler_default_filters){ - validate_legacy(Array, 'validate_array', $scheduler_default_filters) - $scheduler_default_filters_real = join($scheduler_default_filters, ',') + + $scheduler_enabled_filters_raw = pick($scheduler_default_filters, $scheduler_enabled_filters) + if !is_service_default($scheduler_enabled_filters_raw) and !empty($scheduler_enabled_filters_raw){ + validate_legacy(Array, 'validate_array', $scheduler_enabled_filters_raw) + $scheduler_enabled_filters_real = join($scheduler_enabled_filters_raw, ',') } else { - $scheduler_default_filters_real = $::os_service_default + $scheduler_enabled_filters_real = $::os_service_default } if is_array($scheduler_available_filters) { @@ -196,7 +210,7 @@ will be removed in a future release. Use the nova::scheduler::periodic_task_inte 'filter_scheduler/weight_classes': value => $scheduler_weight_classes; 'filter_scheduler/enabled_filters': - value => $scheduler_default_filters_real; + value => $scheduler_enabled_filters_real; 'filter_scheduler/isolated_images': value => $isolated_images_real; 'filter_scheduler/isolated_hosts': diff --git a/releasenotes/notes/deprecate_scheduler_default_filters-79cade007780030f.yaml b/releasenotes/notes/deprecate_scheduler_default_filters-79cade007780030f.yaml new file mode 100644 index 000000000..267f9d327 --- /dev/null +++ b/releasenotes/notes/deprecate_scheduler_default_filters-79cade007780030f.yaml @@ -0,0 +1,6 @@ +--- +deprecations: + - | + nova has renamed the `DEFAULT/scheduler_default_filters` to + `filter_scheduler/enabled_filters`. `scheduler_default_filters` has been + renamed to `scheduler_enabled_filter` to match this change. diff --git a/spec/classes/nova_scheduler_filter_spec.rb b/spec/classes/nova_scheduler_filter_spec.rb index f36dcd24e..81263a2d5 100644 --- a/spec/classes/nova_scheduler_filter_spec.rb +++ b/spec/classes/nova_scheduler_filter_spec.rb @@ -44,7 +44,7 @@ describe 'nova::scheduler::filter' do :max_instances_per_host => '100', :isolated_images => ['ubuntu1','centos2'], :isolated_hosts => ['192.168.1.2','192.168.1.3'], - :scheduler_default_filters => ['RetryFilter','AvailabilityZoneFilter'], + :scheduler_enabled_filters => ['RetryFilter','AvailabilityZoneFilter'], :scheduler_available_filters => ['nova_filter1','nova_filter2'], :scheduler_weight_classes => 'nova.scheduler.weights.compute.BuildFailureWeigher', :track_instance_changes => true, @@ -84,7 +84,7 @@ describe 'nova::scheduler::filter' do { :isolated_images => [], :isolated_hosts => [], :scheduler_available_filters => [], - :scheduler_default_filters => [], + :scheduler_enabled_filters => [], } end