summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/validate_integer.rb
diff options
context:
space:
mode:
authorOliver Bertuch <o.bertuch@fz-juelich.de>2014-12-05 08:48:10 +0100
committerOliver Bertuch <o.bertuch@fz-juelich.de>2014-12-05 08:51:40 +0100
commit305342782998e36e48e1011d12a37c523b838bec (patch)
tree8818dc83d58dfabe4baf3467f8b95bab3c11d6ea /lib/puppet/parser/functions/validate_integer.rb
parent260c1f4b92113a1da3b30562a11d20a79e5b08db (diff)
downloadpuppet-stdlib-305342782998e36e48e1011d12a37c523b838bec.tar.gz
puppet-stdlib-305342782998e36e48e1011d12a37c523b838bec.tar.bz2
Fixing ruby 1.8 support.
Diffstat (limited to 'lib/puppet/parser/functions/validate_integer.rb')
-rw-r--r--lib/puppet/parser/functions/validate_integer.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/validate_integer.rb b/lib/puppet/parser/functions/validate_integer.rb
index c12d676..995f8db 100644
--- a/lib/puppet/parser/functions/validate_integer.rb
+++ b/lib/puppet/parser/functions/validate_integer.rb
@@ -115,6 +115,9 @@ module Puppet::Parser::Functions
raise Puppet::ParseError, "validate_integer(): Expected element at array position #{pos} to be an Integer, got #{arg.class}"
end
end
+ # for the sake of compatibility with ruby 1.8, we need extra handling of hashes
+ when Hash
+ raise Puppet::ParseError, "validate_integer(): Expected first argument to be an Integer or Array, got #{input.class}"
# check the input. this will also fail any stuff other than pure, shiny integers
else
begin