From a4ebae621dd4dc09d760a51b8b221a3250142789 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Fri, 7 Oct 2016 13:00:06 +0100 Subject: (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. --- lib/puppet/functions/validate_numeric.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/puppet/functions/validate_numeric.rb') diff --git a/lib/puppet/functions/validate_numeric.rb b/lib/puppet/functions/validate_numeric.rb index 0c2e1f2..e48bec4 100644 --- a/lib/puppet/functions/validate_numeric.rb +++ b/lib/puppet/functions/validate_numeric.rb @@ -1,3 +1,10 @@ -require 'puppet_x/puppetlabs/stdlib/deprecation_gen' -PuppetX::Puppetlabs::Stdlib.deprecation_gen("validate_numeric", "Stdlib::Compat::Numeric") -# Puppet::Functions.create_function +Puppet::Functions.create_function(:validate_numeric, 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::Numeric. There is further documentation for validate_legacy function in the README.") + scope.send("function_validate_numeric", args) + end +end -- cgit v1.2.3