summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Kraśnicki <paul.krasnicki@gmail.com>2016-07-11 14:26:38 +0200
committerPaweł Kraśnicki <paul.krasnicki@gmail.com>2016-07-12 18:09:52 +0200
commit5bd6d4f1772385777d01691b8ba746f031b1dab0 (patch)
tree4a0d8fd45a2658fc8dadfaf84fcda9f21319d194
parent36fea4846d719f6b3794606f73d6d536a926e541 (diff)
Make parameter validation stricter
-rw-r--r--manifests/init.pp17
1 files changed, 13 insertions, 4 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index f7eddbe..613f0ba 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -23,12 +23,21 @@ class unattended_upgrades (
validate_hash($age)
$_age = merge($::unattended_upgrades::default_age, $age)
+ validate_integer($_age['min'], undef, 0)
+ validate_integer($_age['max'], undef, 0)
validate_hash($auto)
$_auto = merge($::unattended_upgrades::default_auto, $auto)
+ validate_integer($_auto['clean'], undef, 0)
+ validate_bool($_auto['fix_interrupted_dpkg'])
+ validate_bool($_auto['reboot'])
+ validate_string($_auto['reboot_time'])
+ validate_bool($_auto['remove'])
validate_hash($backup)
$_backup = merge($::unattended_upgrades::default_backup, $backup)
+ validate_integer($_backup['archive_interval'], undef, 0)
+ validate_integer($_backup['level'], undef, 0)
validate_array($blacklist)
@@ -47,10 +56,8 @@ class unattended_upgrades (
}
validate_hash($mail)
- if $mail['only_on_error'] {
- validate_bool($mail['only_on_error'])
- }
$_mail = merge($::unattended_upgrades::default_mail, $mail)
+ validate_bool($_mail['only_on_error'])
validate_bool($minimal_steps)
@@ -60,7 +67,7 @@ class unattended_upgrades (
validate_integer($random_sleep, undef, 0)
}
- validate_integer($size)
+ validate_integer($size, undef, 0)
validate_integer($update, undef, 0)
@@ -68,6 +75,8 @@ class unattended_upgrades (
validate_hash($upgradeable_packages)
$_upgradeable_packages = merge($::unattended_upgrades::default_upgradeable_packages, $upgradeable_packages)
+ validate_integer($_upgradeable_packages['download_only'], undef, 0)
+ validate_integer($_upgradeable_packages['debdelta'], undef, 0)
validate_integer($verbose, undef, 0)