Merge "Move evaluation_interval and older_than to engine"

This commit is contained in:
Jenkins 2016-06-02 16:28:35 +00:00 committed by Gerrit Code Review
commit efae3dbe25
4 changed files with 46 additions and 27 deletions

View File

@ -33,6 +33,20 @@
# of runtime execution objects. Use -1 for no limit. # of runtime execution objects. Use -1 for no limit.
# Defaults to $::os_service_default. # Defaults to $::os_service_default.
# #
# [*evaluation_interval*]
# (Optional) How often will the executions be evaluated
# (in minutes). For example for value 120 the interval
# will be 2 hours (every 2 hours).
# Defaults to $::os_service_default.
#
# [*older_than*]
# (Optional) Evaluate from which time remove executions in minutes.
# For example when older_than = 60, remove all executions
# that finished a 60 minutes ago or more.
# Minimum value is 1.
# Note that only final state execution will remove (SUCCESS/ERROR).
# Defaults to $::os_service_default.
#
class mistral::engine ( class mistral::engine (
$package_ensure = present, $package_ensure = present,
$manage_service = true, $manage_service = true,
@ -41,6 +55,8 @@ class mistral::engine (
$topic = $::os_service_default, $topic = $::os_service_default,
$version = $::os_service_default, $version = $::os_service_default,
$execution_field_size_limit_kb = $::os_service_default, $execution_field_size_limit_kb = $::os_service_default,
$evaluation_interval = $::os_service_default,
$older_than = $::os_service_default,
) { ) {
include ::mistral::params include ::mistral::params
@ -69,10 +85,12 @@ class mistral::engine (
} }
mistral_config { mistral_config {
'engine/host' : value => $host; 'engine/host': value => $host;
'engine/topic' : value => $topic; 'engine/topic': value => $topic;
'engine/version' : value => $version; 'engine/version': value => $version;
'engine/execution_field_size_limit_kb' : value => $execution_field_size_limit_kb; 'engine/execution_field_size_limit_kb': value => $execution_field_size_limit_kb;
'execution_expiration_policy/evaluation_interval': value => $evaluation_interval;
'execution_expiration_policy/older_than': value => $older_than;
} }
} }

View File

@ -29,18 +29,13 @@
# Defaults to $::os_service_default. # Defaults to $::os_service_default.
# #
# [*evaluation_interval*] # [*evaluation_interval*]
# (Optional) How often will the executions be evaluated # (Deprecated) This should now be set via
# (in minutes). For example for value 120 the interval # mistral::engine::evaluation_interval.
# will be 2 hours (every 2 hours). # Defaults to false.
# Defaults to $::os_service_default.
# #
# [*older_than*] # [*older_than*]
# (Optional) Evaluate from which time remove executions in minutes. # (Deprecated) This should now be set via mistral::engine::older_than.
# For example when older_than = 60, remove all executions # Defaults to false.
# that finished a 60 minutes ago or more.
# Minimum value is 1.
# Note that only final state execution will remove (SUCCESS/ERROR).
# Defaults to $::os_service_default.
# #
class mistral::executor ( class mistral::executor (
$package_ensure = present, $package_ensure = present,
@ -49,12 +44,20 @@ class mistral::executor (
$host = $::os_service_default, $host = $::os_service_default,
$topic = $::os_service_default, $topic = $::os_service_default,
$version = $::os_service_default, $version = $::os_service_default,
$evaluation_interval = $::os_service_default, #DEPRECATED
$older_than = $::os_service_default, $evaluation_interval = false,
$older_than = false,
) { ) {
include ::mistral::params include ::mistral::params
if $evaluation_interval {
warning('evaluation_interval is deprecated here. Please use mistral::engine::evaluation_interval instead.')
}
if $older_than {
warning('older_than is deprecated here. Please use mistral::engine::older_than instead.')
}
package { 'mistral-executor': package { 'mistral-executor':
ensure => $package_ensure, ensure => $package_ensure,
name => $::mistral::params::executor_package_name, name => $::mistral::params::executor_package_name,
@ -79,11 +82,9 @@ class mistral::executor (
} }
mistral_config { mistral_config {
'executor/host' : value => $host; 'executor/host': value => $host;
'executor/topic' : value => $topic; 'executor/topic': value => $topic;
'executor/version' : value => $version; 'executor/version': value => $version;
'execution_expiration_policy/evaluation_interval' : value => $evaluation_interval;
'execution_expiration_policy/older_than' : value => $older_than;
} }
} }

View File

@ -8,7 +8,9 @@ describe 'mistral::engine' do
:host => 'foo_host', :host => 'foo_host',
:topic => 'foo_topic', :topic => 'foo_topic',
:version => '1.0', :version => '1.0',
:execution_field_size_limit_kb => '1234'} :execution_field_size_limit_kb => '1234',
:evaluation_interval => 1234,
:older_than => 60}
end end
shared_examples_for 'mistral-engine' do shared_examples_for 'mistral-engine' do
@ -21,6 +23,8 @@ describe 'mistral::engine' do
it { is_expected.to contain_mistral_config('engine/topic').with_value( params[:topic] ) } it { is_expected.to contain_mistral_config('engine/topic').with_value( params[:topic] ) }
it { is_expected.to contain_mistral_config('engine/version').with_value( params[:version] ) } it { is_expected.to contain_mistral_config('engine/version').with_value( params[:version] ) }
it { is_expected.to contain_mistral_config('engine/execution_field_size_limit_kb').with_value( params[:execution_field_size_limit_kb] ) } it { is_expected.to contain_mistral_config('engine/execution_field_size_limit_kb').with_value( params[:execution_field_size_limit_kb] ) }
it { is_expected.to contain_mistral_config('execution_expiration_policy/evaluation_interval').with_value( params[:evaluation_interval] ) }
it { is_expected.to contain_mistral_config('execution_expiration_policy/older_than').with_value( params[:older_than] ) }
end end

View File

@ -7,9 +7,7 @@ describe 'mistral::executor' do
:manage_service => true, :manage_service => true,
:host => true, :host => true,
:topic => true, :topic => true,
:version => true, :version => true}
:evaluation_interval => 1234,
:older_than => 60}
end end
shared_examples_for 'mistral-executor' do shared_examples_for 'mistral-executor' do
@ -21,8 +19,6 @@ describe 'mistral::executor' do
it { is_expected.to contain_mistral_config('executor/host').with_value( params[:host] ) } it { is_expected.to contain_mistral_config('executor/host').with_value( params[:host] ) }
it { is_expected.to contain_mistral_config('executor/topic').with_value( params[:topic] ) } it { is_expected.to contain_mistral_config('executor/topic').with_value( params[:topic] ) }
it { is_expected.to contain_mistral_config('executor/version').with_value( params[:version] ) } it { is_expected.to contain_mistral_config('executor/version').with_value( params[:version] ) }
it { is_expected.to contain_mistral_config('execution_expiration_policy/evaluation_interval').with_value( params[:evaluation_interval] ) }
it { is_expected.to contain_mistral_config('execution_expiration_policy/older_than').with_value( params[:older_than] ) }
end end