Age | Commit message (Collapse) | Author | |
---|---|---|---|
2015-07-09 | Add validate_slength's optional 3rd arg to README | Alexander Fisher | |
2013-08-12 | (maint) Validate input argument in a single location | Adrien Thebo | |
2013-08-12 | (maint) reindent case statement to match standard indentation | Adrien Thebo | |
2013-08-12 | (maint) collapse String/Array validation into shared lambda | Adrien Thebo | |
2013-08-12 | (maint) clean up validate_slength argument validation | Adrien Thebo | |
2013-08-12 | (maint) reword error messages for validate_slength | Adrien Thebo | |
2013-08-12 | (maint) Explicitly unpack validate_slength args | Adrien Thebo | |
2013-08-12 | (maint) Remove unneeded parens around exceptions | Adrien Thebo | |
2013-08-08 | Fix validate_slength, arg.length should be args[0].length | Hubert | |
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-06 | changed the validate_slength function to accept a min length | Martin 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 test | Chris 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. |