summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions
diff options
context:
space:
mode:
authorAdrien Thebo <git@somethingsinistral.net>2013-03-18 15:38:14 -0700
committerAdrien Thebo <git@somethingsinistral.net>2013-03-18 15:38:14 -0700
commit6dfd7f6b73c4f9437058609f43d0065d52e36494 (patch)
treeaa5f372f5fcf14a7e272b7939f82f4f217578d90 /lib/puppet/parser/functions
parent5a11279cc54e7f9f5d168c75728f990d0bd0b694 (diff)
parent2c1b2c07c2d09464377cbde7b21952c99877751c (diff)
downloadpuppet-stdlib-6dfd7f6b73c4f9437058609f43d0065d52e36494.tar.gz
puppet-stdlib-6dfd7f6b73c4f9437058609f43d0065d52e36494.tar.bz2
Merge branch '4.x'
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r--lib/puppet/parser/functions/str2bool.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/str2bool.rb b/lib/puppet/parser/functions/str2bool.rb
index 0509c2b..fece7a6 100644
--- a/lib/puppet/parser/functions/str2bool.rb
+++ b/lib/puppet/parser/functions/str2bool.rb
@@ -14,6 +14,11 @@ like: 0, f, n, false, no to 'false'.
"given (#{arguments.size} for 1)") if arguments.size < 1
string = arguments[0]
+
+ # If string is already Boolean, return it
+ if !!string == string
+ return string
+ end
unless string.is_a?(String)
raise(Puppet::ParseError, 'str2bool(): Requires either ' +