diff options
author | Adrien Thebo <git@somethingsinistral.net> | 2013-03-18 15:37:46 -0700 |
---|---|---|
committer | Adrien Thebo <git@somethingsinistral.net> | 2013-03-18 15:37:46 -0700 |
commit | 4c695ede384501b9c516cc53bdfc6b547a6e5ea2 (patch) | |
tree | 4011d4942030d73e063a4d632b90392c54c6120c /lib | |
parent | 967f9916d16ea4f5a8557c9c66ddb878872337ca (diff) | |
parent | 5d5a4d466ed6530fa8b68162e96bdaaaf35066e1 (diff) |
Merge branch 'pull-115' into 2.x
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/parser/functions/str2bool.rb | 5 |
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 ' + |