Merge "Deprecate ironic::conductor::max_time_interval"

This commit is contained in:
Zuul 2020-04-13 05:18:58 +00:00 committed by Gerrit Code Review
commit b3a86860f1
3 changed files with 19 additions and 11 deletions

View File

@ -31,11 +31,6 @@
# (optional) Array of hardware types to load during service initialization. # (optional) Array of hardware types to load during service initialization.
# Defaults to ['ipmi']. # Defaults to ['ipmi'].
# #
# [*max_time_interval*]
# (optional) Maximum time, in seconds, since the last check-in of a conductor.
# Should be an interger value
# Defaults to '120'.
#
# [*force_power_state_during_sync*] # [*force_power_state_during_sync*]
# (optional) Should the hardware power state be set to the state recorded in # (optional) Should the hardware power state be set to the state recorded in
# the database (True) or should the database be updated based on the hardware # the database (True) or should the database be updated based on the hardware
@ -202,11 +197,17 @@
# after the next heartbeat. # after the next heartbeat.
# Defaults to $::os_service_default # Defaults to $::os_service_default
# #
# DEPRECATED PARAMETERS
#
# [*max_time_interval*]
# (optional) Maximum time, in seconds, since the last check-in of a conductor.
# Should be an interger value
# Defaults to undef.
#
class ironic::conductor ( class ironic::conductor (
$package_ensure = 'present', $package_ensure = 'present',
$enabled = true, $enabled = true,
$enabled_hardware_types = ['ipmi'], $enabled_hardware_types = ['ipmi'],
$max_time_interval = '120',
$force_power_state_during_sync = true, $force_power_state_during_sync = true,
$http_url = $::os_service_default, $http_url = $::os_service_default,
$http_root = $::os_service_default, $http_root = $::os_service_default,
@ -239,6 +240,8 @@ class ironic::conductor (
$rescue_kernel = $::os_service_default, $rescue_kernel = $::os_service_default,
$rescue_ramdisk = $::os_service_default, $rescue_ramdisk = $::os_service_default,
$allow_provisioning_in_maintenance = $::os_service_default, $allow_provisioning_in_maintenance = $::os_service_default,
# DEPRECATED PARAMETERS
$max_time_interval = undef,
) { ) {
include ironic::deps include ironic::deps
@ -247,6 +250,10 @@ class ironic::conductor (
# For backward compatibility # For backward compatibility
include ironic::glance include ironic::glance
if $max_time_interval != undef {
warning('ironic::conductor::max_time_interval is deprecated and has no effect')
}
if ($cleaning_network_name and !is_service_default($cleaning_network)) { if ($cleaning_network_name and !is_service_default($cleaning_network)) {
fail('cleaning_network_name and cleaning_network can not be specified at the same time.') fail('cleaning_network_name and cleaning_network can not be specified at the same time.')
} }
@ -307,7 +314,6 @@ class ironic::conductor (
# Configure ironic.conf # Configure ironic.conf
ironic_config { ironic_config {
'DEFAULT/enabled_hardware_types': value => join($enabled_hardware_types, ','); 'DEFAULT/enabled_hardware_types': value => join($enabled_hardware_types, ',');
'conductor/max_time_interval': value => $max_time_interval;
'conductor/force_power_state_during_sync': value => $force_power_state_during_sync; 'conductor/force_power_state_during_sync': value => $force_power_state_during_sync;
'conductor/automated_clean': value => $automated_clean; 'conductor/automated_clean': value => $automated_clean;
'conductor/api_url': value => $api_url; 'conductor/api_url': value => $api_url;

View File

@ -0,0 +1,6 @@
---
deprecations:
- |
The ironic::conductor::max_time_interval was deprecated and has no effect.
The parameter will be removed in a future release.

View File

@ -26,7 +26,6 @@ describe 'ironic::conductor' do
{ :package_ensure => 'present', { :package_ensure => 'present',
:enabled => true, :enabled => true,
:enabled_hardware_types => ['ipmi'], :enabled_hardware_types => ['ipmi'],
:max_time_interval => '120',
:force_power_state_during_sync => true } :force_power_state_during_sync => true }
end end
@ -63,7 +62,6 @@ describe 'ironic::conductor' do
it 'configures ironic.conf' do it 'configures ironic.conf' do
is_expected.to contain_ironic_config('DEFAULT/enabled_hardware_types').with_value('ipmi') is_expected.to contain_ironic_config('DEFAULT/enabled_hardware_types').with_value('ipmi')
is_expected.to contain_ironic_config('conductor/max_time_interval').with_value(p[:max_time_interval])
is_expected.to contain_ironic_config('conductor/force_power_state_during_sync').with_value(p[:force_power_state_during_sync]) is_expected.to contain_ironic_config('conductor/force_power_state_during_sync').with_value(p[:force_power_state_during_sync])
is_expected.to contain_ironic_config('conductor/automated_clean').with(:value => '<SERVICE DEFAULT>') is_expected.to contain_ironic_config('conductor/automated_clean').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('conductor/api_url').with(:value => '<SERVICE DEFAULT>') is_expected.to contain_ironic_config('conductor/api_url').with(:value => '<SERVICE DEFAULT>')
@ -92,7 +90,6 @@ describe 'ironic::conductor' do
before :each do before :each do
params.merge!( params.merge!(
:enabled_hardware_types => ['ipmi', 'irmc'], :enabled_hardware_types => ['ipmi', 'irmc'],
:max_time_interval => '50',
:force_power_state_during_sync => false, :force_power_state_during_sync => false,
:automated_clean => false, :automated_clean => false,
:cleaning_network => '00000000-0000-0000-0000-000000000000', :cleaning_network => '00000000-0000-0000-0000-000000000000',
@ -124,7 +121,6 @@ describe 'ironic::conductor' do
end end
it 'should replace default parameter with new value' do it 'should replace default parameter with new value' do
is_expected.to contain_ironic_config('DEFAULT/enabled_hardware_types').with_value('ipmi,irmc') is_expected.to contain_ironic_config('DEFAULT/enabled_hardware_types').with_value('ipmi,irmc')
is_expected.to contain_ironic_config('conductor/max_time_interval').with_value(p[:max_time_interval])
is_expected.to contain_ironic_config('conductor/force_power_state_during_sync').with_value(p[:force_power_state_during_sync]) is_expected.to contain_ironic_config('conductor/force_power_state_during_sync').with_value(p[:force_power_state_during_sync])
is_expected.to contain_ironic_config('conductor/automated_clean').with_value(p[:automated_clean]) is_expected.to contain_ironic_config('conductor/automated_clean').with_value(p[:automated_clean])
is_expected.to contain_ironic_config('conductor/api_url').with_value(p[:api_url]) is_expected.to contain_ironic_config('conductor/api_url').with_value(p[:api_url])