diff options
author | David Schmitt <david.schmitt@puppet.com> | 2016-08-17 14:46:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-17 14:46:12 +0100 |
commit | 0acff935f8b12938f0a21769a8959a8ba983e60d (patch) | |
tree | 8c33ddb7b86b324b6784059fcb4a4f71182de7fe /lib | |
parent | 88e9045fe894286458093ceb729277089a4f67d6 (diff) | |
parent | 6d185bdaa19f698270a0df4b0a0c05618864b955 (diff) |
Merge pull request #637 from HelenCampbell/ipdeprecation
(MODULES-3534) Deprecation of ip functions
Diffstat (limited to 'lib')
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 ] |