From 3375efcfd45ec2f417bc94f99701a5f68c31f731 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 26 Apr 2021 21:41:16 +0900 Subject: [PATCH] Deprecate support for [scheduler] periodic_task_interval ... because the parameter was removed from nova[1]. [1] 9d53f366ff8c9a29c4ddbf0fa27febbce7442fc9 Change-Id: Ie2e2c40a37c5d206ef483f48fac04a027f793b4b --- manifests/scheduler.pp | 26 +++++++++++++------ ...riodic_task_interval-ca35e588c0cbe546.yaml | 5 ++++ spec/classes/nova_scheduler_spec.rb | 10 +------ 3 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 releasenotes/notes/deprecate-scheduler-periodic_task_interval-ca35e588c0cbe546.yaml diff --git a/manifests/scheduler.pp b/manifests/scheduler.pp index e257bf85b..6b42738fd 100644 --- a/manifests/scheduler.pp +++ b/manifests/scheduler.pp @@ -24,12 +24,6 @@ # (optional) Maximum number of attempts to schedule an instance # Defaults to $::os_service_default # -# [*periodic_task_interval*] -# (Optional) This value controls how often (in seconds) to run periodic tasks -# in the scheduler. The specific tasks that are run for each period are -# determined by the particular scheduler being used. -# Defaults to $::os_service_default -# # [*discover_hosts_in_cells_interval*] # (Optional) This value controls how often (in seconds) the scheduler should # attempt to discover new hosts that have been added to cells. @@ -79,13 +73,20 @@ # compute hosts affined to routed network segment aggregates. # Defaults to $::os_service_default # +# DEPRECATED PARAMETERS +# +# [*periodic_task_interval*] +# (Optional) This value controls how often (in seconds) to run periodic tasks +# in the scheduler. The specific tasks that are run for each period are +# determined by the particular scheduler being used. +# Defaults to undef +# class nova::scheduler( $enabled = true, $manage_service = true, $ensure_package = 'present', $workers = $::os_workers, $max_attempts = $::os_service_default, - $periodic_task_interval = $::os_service_default, $discover_hosts_in_cells_interval = $::os_service_default, $query_placement_for_image_type_support = $::os_service_default, $limit_tenants_to_placement_aggregate = $::os_service_default, @@ -94,6 +95,8 @@ class nova::scheduler( $enable_isolated_aggregate_filtering = $::os_service_default, $query_placement_for_availability_zone = $::os_service_default, $query_placement_for_routed_network_aggregates = $::os_service_default, + # DEPRECATED PARAMETERS + $periodic_task_interval = undef, ) { include nova::deps @@ -101,6 +104,10 @@ class nova::scheduler( include nova::params include nova::availability_zone + if $periodic_task_interval != undef { + warning('The periodic_task_interval parameter is depreated and has no effect') + } + nova::generic_service { 'scheduler': enabled => $enabled, manage_service => $manage_service, @@ -112,7 +119,6 @@ class nova::scheduler( nova_config { 'scheduler/workers': value => $workers; 'scheduler/max_attempts': value => $max_attempts; - 'scheduler/periodic_task_interval': value => $periodic_task_interval; 'scheduler/discover_hosts_in_cells_interval': value => $discover_hosts_in_cells_interval; 'scheduler/query_placement_for_image_type_support': value => $query_placement_for_image_type_support; 'scheduler/limit_tenants_to_placement_aggregate': value => $limit_tenants_to_placement_aggregate; @@ -122,4 +128,8 @@ class nova::scheduler( 'scheduler/query_placement_for_availability_zone': value => $query_placement_for_availability_zone; 'scheduler/query_placement_for_routed_network_aggregates': value => $query_placement_for_routed_network_aggregates; } + + nova_config { + 'scheduler/periodic_task_interval': ensure => absent; + } } diff --git a/releasenotes/notes/deprecate-scheduler-periodic_task_interval-ca35e588c0cbe546.yaml b/releasenotes/notes/deprecate-scheduler-periodic_task_interval-ca35e588c0cbe546.yaml new file mode 100644 index 000000000..f2f61c242 --- /dev/null +++ b/releasenotes/notes/deprecate-scheduler-periodic_task_interval-ca35e588c0cbe546.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - | + The ``nova::scheduler::periodic_task_interval`` parameter has been + deprecated and has no effect now. diff --git a/spec/classes/nova_scheduler_spec.rb b/spec/classes/nova_scheduler_spec.rb index 6e8aea1bd..4e8e20f91 100644 --- a/spec/classes/nova_scheduler_spec.rb +++ b/spec/classes/nova_scheduler_spec.rb @@ -19,7 +19,7 @@ describe 'nova::scheduler' do it { is_expected.to contain_nova_config('scheduler/workers').with_value(4) } it { is_expected.to contain_nova_config('scheduler/max_attempts').with_value('') } - it { is_expected.to contain_nova_config('scheduler/periodic_task_interval').with_value('') } + it { is_expected.to contain_nova_config('scheduler/periodic_task_interval').with_ensure('absent') } it { is_expected.to contain_nova_config('scheduler/discover_hosts_in_cells_interval').with_value('') } it { is_expected.to contain_nova_config('scheduler/query_placement_for_image_type_support').with_value('') } it { is_expected.to contain_nova_config('scheduler/limit_tenants_to_placement_aggregate').with_value('') } @@ -66,14 +66,6 @@ describe 'nova::scheduler' do it { is_expected.to contain_nova_config('scheduler/max_attempts').with_value(10) } end - context 'with periodic_task_interval' do - let :params do - { :periodic_task_interval => 300 } - end - - it { is_expected.to contain_nova_config('scheduler/periodic_task_interval').with_value(300) } - end - context 'with discover_hosts_in_cells_interval' do let :params do { :discover_hosts_in_cells_interval => 15 }