From 1af2287ea74465938cdab4354d9f964590282be4 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 6 Sep 2014 18:44:34 -0700 Subject: [PATCH] Added validation to the icinga2::object::idopgsqlconnection class' parameters. --- manifests/object/idopgsqlconnection.pp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/manifests/object/idopgsqlconnection.pp b/manifests/object/idopgsqlconnection.pp index 1cc0232..0c9ae60 100644 --- a/manifests/object/idopgsqlconnection.pp +++ b/manifests/object/idopgsqlconnection.pp @@ -45,6 +45,23 @@ define icinga2::object::idopgsqlconnection ( $target_file_mode = '644' ) { + #Do some validation of the class' parameters: + validate_string($object_name) + validate_string($template_to_import) + validate_string($host) + validate_string($user) + validate_string($password) + validate_string($database) + validate_string($table_prefix) + validate_string($instance_name) + validate_hash($cleanup) + validate_array($categories) + validate_string($target_dir) + validate_string($target_file_name) + validate_string($target_file_owner) + validate_string($target_file_group) + validate_string($target_file_mode) + file {"${target_dir}/${target_file_name}": ensure => file, owner => $target_file_owner,