summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/validate_slength.rb
AgeCommit message (Collapse)Author
2016-10-12(MODULES-3961) emit more deprecation warningsDavid Schmitt
This now emits one deprecation warning for each function used (but not for each call-site). Prior to this, only a single deprecation warning would have been triggered, potentially misleading users. Additionally this adds v4 deprecation stubs for the functions that were missed.
2016-10-07(FM-5703, PUP-6717) Remove the dynamic deprecation_genDavid Schmitt
This was not working when the puppet master did not have the newest stdlib version in its environment.
2016-09-26Add deprecation warnings to remaining validatesHelen Campbell
2015-07-09Add validate_slength's optional 3rd arg to READMEAlexander Fisher
2013-08-12(maint) Validate input argument in a single locationAdrien Thebo
2013-08-12(maint) reindent case statement to match standard indentationAdrien Thebo
2013-08-12(maint) collapse String/Array validation into shared lambdaAdrien Thebo
2013-08-12(maint) clean up validate_slength argument validationAdrien Thebo
2013-08-12(maint) reword error messages for validate_slengthAdrien Thebo
2013-08-12(maint) Explicitly unpack validate_slength argsAdrien Thebo
2013-08-12(maint) Remove unneeded parens around exceptionsAdrien Thebo
2013-08-08Fix validate_slength, arg.length should be args[0].lengthHubert
During a puppet run an error will be thrown and a puppet run will fail completely (when using validate_slength): undefined local variable or method `arg' for #<Puppet::Parser::Scope:0x7f243c236948>
2013-08-06changed the validate_slength function to accept a min lengthMartin Hellmich
An optional third parameter can be given a min length. The function then only passes successfully, if all strings are in the range min_length <= string <= max_length update and fix function and unit tests the check for the minlength has to be written differently because 0 values should be possible. We now check a) if the input is convertible, and throw a ParseError and b) if the input .is_a?(Numeric) and ask for a positive number it's not as clean as for maxlength, but keeps a similar behaviour refined the error checking for the min length try to convert to Integer(args[2]) and fail, if it's not possible changed the tests accordingly to the new parameter checking
2012-02-22(#12776) Added validate_slength function and rspec testChris Spence
This function is used to validate a string is less than a maximum length. The string, or array of strings, is passed as the first argument to the function. The maximum length of the string is passed as the second argument. It is useful to validate, for example, that Puppet is not sending a username to a downstream system that the system cannot cope with, but that might not cause an error message - for example, MySQL will not accept a username of more than 16 characters. This enables a Puppet administrator to validate the data that it may have been passed from upstream through, for example, Hiera.