* fixed typos, changed default values and changed parameters validation.

Signed-off-by: Nick Chappell <nick@intronic.org>

Merged in from: https://github.com/Icinga/puppet-icinga2/pull/33

refs#7215: https://dev.icinga.org/issues/7215
This commit is contained in:
Ricardo Melo 2014-10-22 17:14:59 -04:00 committed by Nick Chappell
parent f9a4feb746
commit 6af3b7b9ae
2 changed files with 10 additions and 5 deletions

View file

@ -15,11 +15,11 @@ define icinga2::object::eventcommand (
/* $methods = undef, */ /* Need to get more details about this attribute */
$command = undef,
$cmd_path = 'PluginDir',
$arguments = {},
$arguments = undef,
$env = undef,
$vars = {},
$vars = undef,
$timeout = undef,
$target_dir = '/etc/icinga2/conf.d',
$target_dir = '/etc/icinga2/objects/eventcommands',
$target_file_name = "${name}.conf",
$target_file_owner = 'root',
$target_file_group = 'root',
@ -31,10 +31,15 @@ define icinga2::object::eventcommand (
validate_string($template_to_import)
validate_array($command)
validate_string($cmd_path)
if $arguments {
validate_hash($arguments)
}
if $env {
validate_hash($env)
}
validate_hash($vars)
if $vars {
validate_hash($vars)
}
if $timeout {
validate_re($timeout, '^\d+$')
}

View file

@ -54,7 +54,7 @@ object EventCommand "<%= @object_eventcommandname %>" {
<%- if @env -%>
env = {
<%- @vars.each_pair do |key,value| -%>
<%- @env.each_pair do |key,value| -%>
<%= key %> = <%= value %>
<%- end -%>
}