]> gitweb.fluxo.info Git - puppet-stdlib.git/commit
allow `match` parameter to influence `ensure => absent` behavior.
authorJohnson Earls <johnson.earls@oracle.com>
Thu, 6 Aug 2015 20:00:11 +0000 (13:00 -0700)
committerJohnson Earls <johnson.earls@oracle.com>
Thu, 6 Aug 2015 20:44:32 +0000 (13:44 -0700)
commit9bacf14ca24283a94883523064603babcd7046d3
treeb8343ca7af2e569efea2a77b4c53bb92a1a8fe47
parent061d0c29fc54391f3e713e9ed76da3933b19083b
allow `match` parameter to influence `ensure => absent` behavior.

Split the `destroy` method of the file_type::ruby provider into two
private methods:  `handle_destroy_line` which is the same as the previous
`destroy` method, and `handle_destroy_with_match` which will destroy any
line which matches the `match` parameter, raising an error if multiple
lines match and the `multiple` parameter is not `true`.  This new
behavior is only used if the new boolean parameter `match_for_absence`
is `true` (it defaults to `false`).
lib/puppet/provider/file_line/ruby.rb
lib/puppet/type/file_line.rb
spec/unit/puppet/provider/file_line/ruby_spec.rb