From 993b2e5e4c9e59adbabfd182e844bfd94b049a4b Mon Sep 17 00:00:00 2001 From: Jeff McCune Date: Wed, 25 May 2011 16:07:10 -0700 Subject: [PATCH] Fixup validation for Puppet 2.6.8 Anonymous arrays and comparing booleans does not work in 2.6.8 like they do in master. In 2.6.8 we cannot compare a true / false variable to a string inside of Ruby without forcing the function argument to be a string. --- manifests/init.pp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index f3ae555..f8dd0a2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -17,8 +17,11 @@ class java( $version='1.6.0_25-fcs' ) { - validate_re($jre, [ '^true$', '^false$' ]) - validate_re($jdk, [ '^true$', '^false$' ]) + # Cannot pass anonymous arrays to functions in 2.6.8 + $v_true_false = [ '^true$', '^false$' ] + # Must compare string values, not booleans. + validate_re("$jre", $v_true_false) + validate_re("$jdk", $v_true_false) validate_re($version, '^[._0-9a-zA-Z:-]+$') $jre_real = $jre