diff options
author | Helen Campbell <helen@puppetlabs.com> | 2016-08-16 11:55:05 +0100 |
---|---|---|
committer | Helen Campbell <helen@puppetlabs.com> | 2016-08-17 13:49:42 +0100 |
commit | 6d185bdaa19f698270a0df4b0a0c05618864b955 (patch) | |
tree | 2d005f4664838214a4e3284e73a2060453a1216c /lib/puppet | |
parent | 1d9d2c02d6669d4a6219140ae7ff3648a30c89cf (diff) |
Deprecation of ip functions
Diffstat (limited to 'lib/puppet')
6 files changed, 12 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/is_ip_address.rb b/lib/puppet/parser/functions/is_ip_address.rb index a90adab..1901b2c 100644 --- a/lib/puppet/parser/functions/is_ip_address.rb +++ b/lib/puppet/parser/functions/is_ip_address.rb @@ -10,6 +10,8 @@ Returns true if the string passed to this function is a valid IP address. require 'ipaddr' + function_deprecation([:puppet_3_type_check, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ip_address. There is further documentation for validate_legacy function in the README.']) + if (arguments.size != 1) then raise(Puppet::ParseError, "is_ip_address(): Wrong number of arguments "+ "given #{arguments.size} for 1") diff --git a/lib/puppet/parser/functions/is_ipv4_address.rb b/lib/puppet/parser/functions/is_ipv4_address.rb index b4861d5..c90fa64 100644 --- a/lib/puppet/parser/functions/is_ipv4_address.rb +++ b/lib/puppet/parser/functions/is_ipv4_address.rb @@ -10,6 +10,8 @@ Returns true if the string passed to this function is a valid IPv4 address. require 'ipaddr' + function_deprecation([:puppet_3_type_check, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ipv4. There is further documentation for validate_legacy function in the README.']) + if (arguments.size != 1) then raise(Puppet::ParseError, "is_ipv4_address(): Wrong number of arguments "+ "given #{arguments.size} for 1") diff --git a/lib/puppet/parser/functions/is_ipv6_address.rb b/lib/puppet/parser/functions/is_ipv6_address.rb index 475ad50..aec3483 100644 --- a/lib/puppet/parser/functions/is_ipv6_address.rb +++ b/lib/puppet/parser/functions/is_ipv6_address.rb @@ -8,6 +8,8 @@ Returns true if the string passed to this function is a valid IPv6 address. EOS ) do |arguments| + function_deprecation([:puppet_3_type_check, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ipv6. There is further documentation for validate_legacy function in the README.']) + require 'ipaddr' if (arguments.size != 1) then diff --git a/lib/puppet/parser/functions/validate_ip_address.rb b/lib/puppet/parser/functions/validate_ip_address.rb index 64fbd75..3377c76 100644 --- a/lib/puppet/parser/functions/validate_ip_address.rb +++ b/lib/puppet/parser/functions/validate_ip_address.rb @@ -23,6 +23,8 @@ module Puppet::Parser::Functions require "ipaddr" rescuable_exceptions = [ ArgumentError ] + function_deprecation([:puppet_3_type_check, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ip_address. There is further documentation for validate_legacy function in the README.']) + if defined?(IPAddr::InvalidAddressError) rescuable_exceptions << IPAddr::InvalidAddressError end diff --git a/lib/puppet/parser/functions/validate_ipv4_address.rb b/lib/puppet/parser/functions/validate_ipv4_address.rb index 97faa57..fb2260c 100644 --- a/lib/puppet/parser/functions/validate_ipv4_address.rb +++ b/lib/puppet/parser/functions/validate_ipv4_address.rb @@ -18,6 +18,8 @@ module Puppet::Parser::Functions ENDHEREDOC ) do |args| + function_deprecation([:puppet_3_type_check, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ipv4. There is further documentation for validate_legacy function in the README.']) + require "ipaddr" rescuable_exceptions = [ ArgumentError ] diff --git a/lib/puppet/parser/functions/validate_ipv6_address.rb b/lib/puppet/parser/functions/validate_ipv6_address.rb index b0f2558..4dedcd6 100644 --- a/lib/puppet/parser/functions/validate_ipv6_address.rb +++ b/lib/puppet/parser/functions/validate_ipv6_address.rb @@ -19,6 +19,8 @@ module Puppet::Parser::Functions ENDHEREDOC ) do |args| + function_deprecation([:puppet_3_type_check, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ipv6. There is further documentation for validate_legacy function in the README.']) + require "ipaddr" rescuable_exceptions = [ ArgumentError ] |