Merge "Allow customization of force_power_state_during_sync"

This commit is contained in:
Jenkins
2015-07-14 18:21:40 +00:00
committed by Gerrit Code Review
2 changed files with 21 additions and 7 deletions

View File

@@ -32,10 +32,17 @@
# Should be an interger value
# Defaults to '120'.
#
# [*force_power_state_during_sync*]
# (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
# state (False).
# Defaults to true.
#
class ironic::conductor (
$package_ensure = 'present',
$enabled = true,
$max_time_interval = '120'
$package_ensure = 'present',
$enabled = true,
$max_time_interval = '120',
$force_power_state_during_sync = true,
) {
include ::ironic::params
@@ -45,6 +52,7 @@ class ironic::conductor (
# Configure ironic.conf
ironic_config {
'conductor/max_time_interval': value => $max_time_interval;
'conductor/force_power_state_during_sync': value => $force_power_state_during_sync;
}
# Install package

View File

@@ -23,9 +23,10 @@ require 'spec_helper'
describe 'ironic::conductor' do
let :default_params do
{ :package_ensure => 'present',
:enabled => true,
:max_time_interval => '120' }
{ :package_ensure => 'present',
:enabled => true,
:max_time_interval => '120',
:force_power_state_during_sync => true }
end
let :params do
@@ -57,14 +58,19 @@ describe 'ironic::conductor' do
it 'configures ironic.conf' do
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])
end
context 'when overriding parameters' do
before :each do
params.merge!(:max_time_interval => '50')
params.merge!(
:max_time_interval => '50',
:force_power_state_during_sync => false
)
end
it 'should replace default parameter with new value' do
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])
end
end