summaryrefslogtreecommitdiff
path: root/lib/puppet/type/file_line.rb
diff options
context:
space:
mode:
authorHailee Kenney <hailee@puppetlabs.com>2016-10-06 15:23:35 -0700
committerHailee Kenney <hailee@puppetlabs.com>2016-10-06 15:31:47 -0700
commitbcab71ded8507de4fd9f89b4dcf798b3d98ace59 (patch)
treea2c2689d612e142f821492fda11ef4e9a55e204a /lib/puppet/type/file_line.rb
parentc046716de30c55662cff0d11efa573f0d572d984 (diff)
(MODULES-3590) Fix match_for_absence parameter
Prior to this commit, due to a bug in the exists? method in the file_line provider, match_for_absence didn't work as described (or at all really). Update the exists? logic so that match_for_absence works as described. Additionally add a unit test to prevent regressions and update the documentation for the parameter to reflect the fact that it is ignored when `ensure => present`.
Diffstat (limited to 'lib/puppet/type/file_line.rb')
-rw-r--r--lib/puppet/type/file_line.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/puppet/type/file_line.rb b/lib/puppet/type/file_line.rb
index 6f5c188..7b7d44e 100644
--- a/lib/puppet/type/file_line.rb
+++ b/lib/puppet/type/file_line.rb
@@ -71,7 +71,8 @@ Puppet::Type.newtype(:file_line) do
newparam(:match_for_absence) do
desc 'An optional value to determine if match should be applied when ensure => absent.' +
' If set to true and match is set, the line that matches match will be deleted.' +
- ' If set to false (the default), match is ignored when ensure => absent.'
+ ' If set to false (the default), match is ignored when ensure => absent.' +
+ ' When `ensure => present`, match_for_absence is ignored.'
newvalues(true, false)
defaultto false
end