Merge "Deprecate support for [scheduler] periodic_task_interval"

This commit is contained in:
Zuul 2021-04-27 16:12:24 +00:00 committed by Gerrit Code Review
commit 5f2e534936
3 changed files with 24 additions and 17 deletions

View File

@ -24,12 +24,6 @@
# (optional) Maximum number of attempts to schedule an instance # (optional) Maximum number of attempts to schedule an instance
# Defaults to $::os_service_default # 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*] # [*discover_hosts_in_cells_interval*]
# (Optional) This value controls how often (in seconds) the scheduler should # (Optional) This value controls how often (in seconds) the scheduler should
# attempt to discover new hosts that have been added to cells. # attempt to discover new hosts that have been added to cells.
@ -79,13 +73,20 @@
# compute hosts affined to routed network segment aggregates. # compute hosts affined to routed network segment aggregates.
# Defaults to $::os_service_default # 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( class nova::scheduler(
$enabled = true, $enabled = true,
$manage_service = true, $manage_service = true,
$ensure_package = 'present', $ensure_package = 'present',
$workers = $::os_workers, $workers = $::os_workers,
$max_attempts = $::os_service_default, $max_attempts = $::os_service_default,
$periodic_task_interval = $::os_service_default,
$discover_hosts_in_cells_interval = $::os_service_default, $discover_hosts_in_cells_interval = $::os_service_default,
$query_placement_for_image_type_support = $::os_service_default, $query_placement_for_image_type_support = $::os_service_default,
$limit_tenants_to_placement_aggregate = $::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, $enable_isolated_aggregate_filtering = $::os_service_default,
$query_placement_for_availability_zone = $::os_service_default, $query_placement_for_availability_zone = $::os_service_default,
$query_placement_for_routed_network_aggregates = $::os_service_default, $query_placement_for_routed_network_aggregates = $::os_service_default,
# DEPRECATED PARAMETERS
$periodic_task_interval = undef,
) { ) {
include nova::deps include nova::deps
@ -101,6 +104,10 @@ class nova::scheduler(
include nova::params include nova::params
include nova::availability_zone 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': nova::generic_service { 'scheduler':
enabled => $enabled, enabled => $enabled,
manage_service => $manage_service, manage_service => $manage_service,
@ -112,7 +119,6 @@ class nova::scheduler(
nova_config { nova_config {
'scheduler/workers': value => $workers; 'scheduler/workers': value => $workers;
'scheduler/max_attempts': value => $max_attempts; '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/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/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; '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_availability_zone': value => $query_placement_for_availability_zone;
'scheduler/query_placement_for_routed_network_aggregates': value => $query_placement_for_routed_network_aggregates; 'scheduler/query_placement_for_routed_network_aggregates': value => $query_placement_for_routed_network_aggregates;
} }
nova_config {
'scheduler/periodic_task_interval': ensure => absent;
}
} }

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
The ``nova::scheduler::periodic_task_interval`` parameter has been
deprecated and has no effect now.

View File

@ -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/workers').with_value(4) }
it { is_expected.to contain_nova_config('scheduler/max_attempts').with_value('<SERVICE DEFAULT>') } it { is_expected.to contain_nova_config('scheduler/max_attempts').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_nova_config('scheduler/periodic_task_interval').with_value('<SERVICE DEFAULT>') } 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('<SERVICE DEFAULT>') } it { is_expected.to contain_nova_config('scheduler/discover_hosts_in_cells_interval').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_nova_config('scheduler/query_placement_for_image_type_support').with_value('<SERVICE DEFAULT>') } it { is_expected.to contain_nova_config('scheduler/query_placement_for_image_type_support').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_nova_config('scheduler/limit_tenants_to_placement_aggregate').with_value('<SERVICE DEFAULT>') } it { is_expected.to contain_nova_config('scheduler/limit_tenants_to_placement_aggregate').with_value('<SERVICE DEFAULT>') }
@ -66,14 +66,6 @@ describe 'nova::scheduler' do
it { is_expected.to contain_nova_config('scheduler/max_attempts').with_value(10) } it { is_expected.to contain_nova_config('scheduler/max_attempts').with_value(10) }
end 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 context 'with discover_hosts_in_cells_interval' do
let :params do let :params do
{ :discover_hosts_in_cells_interval => 15 } { :discover_hosts_in_cells_interval => 15 }