From dd60a1fc5e5344bf9b6af8bf5fafa3a9aab6ef11 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Sat, 2 Nov 2013 00:50:54 +0100 Subject: [PATCH] Alarm: record history support Ceilometer Alarm is able to record alarm change events. This patch add this support in manifest. Change-Id: Id8ece03dfd3491cd2886a345771df9622d702190 Signed-off-by: Emilien Macchi (cherry picked from commit 24a712516bb721bd62ead06cabadc631b8b7f060) --- manifests/alarm/evaluator.pp | 4 ++++ spec/classes/ceilometer_alarm_evaluator_spec.rb | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/manifests/alarm/evaluator.pp b/manifests/alarm/evaluator.pp index 60f5ac06d..16cc0a12e 100644 --- a/manifests/alarm/evaluator.pp +++ b/manifests/alarm/evaluator.pp @@ -9,12 +9,15 @@ # define which service use for the evaluator # [*partition_rpc_topic*] # define which topic the alarm evaluator should access +# [*record_history*] +# Record alarm change events # class ceilometer::alarm::evaluator ( $enabled = true, $evaluation_interval = 60, $evaluation_service = 'ceilometer.alarm.service.SingletonAlarmService', $partition_rpc_topic = 'alarm_partition_coordination', + $record_history = true, ) { include ceilometer::params @@ -52,5 +55,6 @@ 'alarm/evaluation_interval' : value => $evaluation_interval; 'alarm/evaluation_service' : value => $evaluation_service; 'alarm/partition_rpc_topic' : value => $partition_rpc_topic; + 'alarm/record_history' : value => $record_history; } } diff --git a/spec/classes/ceilometer_alarm_evaluator_spec.rb b/spec/classes/ceilometer_alarm_evaluator_spec.rb index 399f82f29..e77f139f0 100644 --- a/spec/classes/ceilometer_alarm_evaluator_spec.rb +++ b/spec/classes/ceilometer_alarm_evaluator_spec.rb @@ -10,6 +10,7 @@ { :evaluation_interval => 60, :evaluation_service => 'ceilometer.alarm.service.SingletonAlarmService', :partition_rpc_topic => 'alarm_partition_coordination', + :record_history => true, :enabled => true, } end @@ -46,16 +47,19 @@ should contain_ceilometer_config('alarm/evaluation_interval').with_value( params[:evaluation_interval] ) should contain_ceilometer_config('alarm/evaluation_service').with_value( params[:evaluation_service] ) should contain_ceilometer_config('alarm/partition_rpc_topic').with_value (params[:partition_rpc_topic] ) + should contain_ceilometer_config('alarm/record_history').with_value (params[:record_history] ) end context 'when overriding parameters' do before do params.merge!(:evaluation_interval => 80, :partition_rpc_topic => 'alarm_partition_coordination', + :record_history => false, :evaluation_service => 'ceilometer.alarm.service.SingletonTestAlarmService') end it { should contain_ceilometer_config('alarm/evaluation_interval').with_value(params[:evaluation_interval]) } it { should contain_ceilometer_config('alarm/evaluation_service').with_value(params[:evaluation_service]) } + it { should contain_ceilometer_config('alarm/record_history').with_value(params[:record_history]) } it { should contain_ceilometer_config('alarm/partition_rpc_topic').with_value(params[:partition_rpc_topic]) } end