summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdrien Thebo <git@somethingsinistral.net>2013-03-18 15:37:56 -0700
committerAdrien Thebo <git@somethingsinistral.net>2013-03-18 15:37:56 -0700
commitc0a0682706ccc1ed8c927c5529c08ffe2a7a4a5e (patch)
tree82b093297dfec93464ee11ccebc16a4d7cf17216 /lib
parentc12d3d7d51da4107f5e0b63aacc4fcb2c5923a0b (diff)
parent4c695ede384501b9c516cc53bdfc6b547a6e5ea2 (diff)
downloadpuppet-stdlib-c0a0682706ccc1ed8c927c5529c08ffe2a7a4a5e.tar.gz
puppet-stdlib-c0a0682706ccc1ed8c927c5529c08ffe2a7a4a5e.tar.bz2
Merge branch '2.x' into 3.x
Diffstat (limited to 'lib')
-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 c320da6..9ea6dd5 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 ' +