summaryrefslogtreecommitdiff
path: root/lib/puppet/provider
diff options
context:
space:
mode:
authorDavid Schmitt <david.schmitt@puppet.com>2016-10-07 11:58:12 +0100
committerGitHub <noreply@github.com>2016-10-07 11:58:12 +0100
commite7825bc9dd0c33c986fcdc5e6dfd11c6cded8ca1 (patch)
treea2c2689d612e142f821492fda11ef4e9a55e204a /lib/puppet/provider
parentc046716de30c55662cff0d11efa573f0d572d984 (diff)
parentbcab71ded8507de4fd9f89b4dcf798b3d98ace59 (diff)
Merge pull request #666 from HAIL9000/issue/master/MODULES-3590_fix_match_for_absence_parameter
(MODULES-3590) Fix match_for_absence parameter
Diffstat (limited to 'lib/puppet/provider')
-rw-r--r--lib/puppet/provider/file_line/ruby.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/puppet/provider/file_line/ruby.rb b/lib/puppet/provider/file_line/ruby.rb
index aab6fe2..beeb430 100644
--- a/lib/puppet/provider/file_line/ruby.rb
+++ b/lib/puppet/provider/file_line/ruby.rb
@@ -4,7 +4,11 @@ Puppet::Type.type(:file_line).provide(:ruby) do
true
else
lines.find do |line|
- line.chomp == resource[:line].chomp
+ if resource[:ensure].to_s == 'absent' and resource[:match_for_absence].to_s == 'true'
+ line.chomp =~ Regexp.new(resource[:match])
+ else
+ line.chomp == resource[:line].chomp
+ end
end
end
end