Age | Commit message (Collapse) | Author |
|
|
|
(maint) fix RST formatting of has_interface_with code examples
|
|
Update file_line resource to support 'after'.
|
|
|
|
Without this patch the implementation of the file_line provider is a bit
convoluted with respect to the newly introduced "after" parameter.
This patch addresses the problem by separating out the concerns of each
case into their own methods of handling the behavior with the match
parameter, handling the behavior with the after parameter, or simply
appending the line.
|
|
When adding new lines to a file the 'after' option can be useful
when you need to insert file lines into the middle of a file.
This is particularly helpful when using file_line with sectioned
config files.
NOTE: the after option only works when adding new lines. If you are
updating an existing (matched) line it will simply modify it in place.
This assumes it was in the right place to begin with.
|
|
Without this patch the stdlib spec tests are failing against recent
versions of Puppet. The root cause of this problem is a change in the
behavior of create_resources in Puppet 6baa57b. The change in behavior
caused the :name key to be omitted from the hash returned by
Puppet::Parser::Resource#to_hash which in turn is causing the test
failure.
This patch addresses the problem by updating the test to match the
description of the example. Only the attribute :ensure is checked
instead of the full hash itself.
|
|
Without this patch the location_for helper method in the Gemfile
incorrectly assumes the mdata variable has a value. This patch
addresses the problem by explicitly binding the regular expression match
results to the mdata variable to ensure it has a value when accessed by
index.
|
|
small fix to delete_values_spec.rb and README.markdown
|
|
|
|
minor corrections to delete_values()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fix validate_slength, arg.length should be args[0].length
|
|
|
|
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>
|
|
extend the validate_slength function to accept a minimum length
|
|
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
|
|
Add delete_values() and delete_undef_values() functions
|
|
|
|
This closes GH-164
|
|
Conform to RFC per comments on: https://github.com/puppetlabs/puppetlabs-stdlib/pull/164
Conflicts:
lib/puppet/parser/functions/uriescape.rb
spec/unit/puppet/parser/functions/uriescape_spec.rb
|
|
This closes GH-163
|
|
Without this commit the file_line type will outright fail if multiple
lines match the given regex. This commit allows the file_line type and
provider to optionally match and modify all matching lines.
Changeset rebased into a single commit by Adrien Thebo <adrien@puppetlabs.com>
|
|
ensure_resource: fix documentation typo
|
|
|
|
[#20862] Add functions to validate ipv4 and ipv6 addresses
|
|
|
|
|
|
Replace `lambda` with `expect` for making an error expectation
Add an explicit error message in expectation
|
|
|
|
|
|
Conflicts:
lib/puppet/parser/functions/range.rb
spec/unit/puppet/parser/functions/range_spec.rb
|
|
Adding base64 function
|
|
Adding base64 function and spec test. Included a bonus fix to
validate_slength_spec.rb to put the expectation message in the right
place.
|
|
|
|
|
|
|
|
|
|
Trivial documentation fix for upcase function.
|
|
|
|
(#20684) Add array comparison functions, difference, intersection and union
|
|
don't fail on undef variable in merge
|