summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHunter Haugen <hunter@puppet.com>2016-09-26 16:18:55 +0100
committerGitHub <noreply@github.com>2016-09-26 16:18:55 +0100
commit80daf167239d00fdbce38c6f0c86bf8958134368 (patch)
tree1091906b8e5208a5ccc42de776c856f3a3fbf2ad /lib
parentf69cd1a95c39443072da77a8079e5e759f7c366a (diff)
parent055dbb611a60f5d8a6c184e12f8da0b85b8971dd (diff)
Merge pull request #656 from HelenCampbell/hashFupdate
Add deprecation warnings to remaining validates
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/parser/functions/validate_hash.rb2
-rw-r--r--lib/puppet/parser/functions/validate_slength.rb2
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/validate_hash.rb b/lib/puppet/parser/functions/validate_hash.rb
index 9bdd543..800a758 100644
--- a/lib/puppet/parser/functions/validate_hash.rb
+++ b/lib/puppet/parser/functions/validate_hash.rb
@@ -18,6 +18,8 @@ module Puppet::Parser::Functions
ENDHEREDOC
+ function_deprecation([:puppet_3_type_check, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Hash. There is further documentation for validate_legacy function in the README.'])
+
unless args.length > 0 then
raise Puppet::ParseError, ("validate_hash(): wrong number of arguments (#{args.length}; must be > 0)")
end
diff --git a/lib/puppet/parser/functions/validate_slength.rb b/lib/puppet/parser/functions/validate_slength.rb
index 47c7d4a..1641e5a 100644
--- a/lib/puppet/parser/functions/validate_slength.rb
+++ b/lib/puppet/parser/functions/validate_slength.rb
@@ -21,6 +21,8 @@ module Puppet::Parser::Functions
ENDHEREDOC
+ function_deprecation([:puppet_3_type_check, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::String[x]. There is further documentation for validate_legacy function in the README.'])
+
raise Puppet::ParseError, "validate_slength(): Wrong number of arguments (#{args.length}; must be 2 or 3)" unless args.length == 2 or args.length == 3
input, max_length, min_length = *args