summaryrefslogtreecommitdiff
path: root/lib/puppet/functions/validate_integer.rb
diff options
context:
space:
mode:
authorDavid Schmitt <david.schmitt@puppet.com>2016-10-07 13:00:06 +0100
committerDavid Schmitt <david.schmitt@puppet.com>2016-10-07 13:03:50 +0100
commita4ebae621dd4dc09d760a51b8b221a3250142789 (patch)
treebd502b52ff7f0cdb80d91a436bb351ca2100c51b /lib/puppet/functions/validate_integer.rb
parente7825bc9dd0c33c986fcdc5e6dfd11c6cded8ca1 (diff)
(FM-5703, PUP-6717) Remove the dynamic deprecation_gen
This was not working when the puppet master did not have the newest stdlib version in its environment.
Diffstat (limited to 'lib/puppet/functions/validate_integer.rb')
-rw-r--r--lib/puppet/functions/validate_integer.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/puppet/functions/validate_integer.rb b/lib/puppet/functions/validate_integer.rb
index 2c4645d..db95f1c 100644
--- a/lib/puppet/functions/validate_integer.rb
+++ b/lib/puppet/functions/validate_integer.rb
@@ -1,3 +1,10 @@
-require 'puppet_x/puppetlabs/stdlib/deprecation_gen'
-PuppetX::Puppetlabs::Stdlib.deprecation_gen("validate_integer", "Stdlib::Compat::Integer")
-# Puppet::Functions.create_function
+Puppet::Functions.create_function(:validate_integer, Puppet::Functions::InternalFunction) do
+ dispatch :deprecation_gen do
+ scope_param
+ optional_repeated_param 'Any', :args
+ end
+ def deprecation_gen(scope, *args)
+ call_function('deprecation', 'puppet_3_type_check', "This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Integer. There is further documentation for validate_legacy function in the README.")
+ scope.send("function_validate_integer", args)
+ end
+end