From a7adcda803abe82e6a16e2410c10d58abedbd82d Mon Sep 17 00:00:00 2001 From: Dominic Cleal Date: Tue, 4 Aug 2015 09:59:53 +0100 Subject: (MODULES-2316) Change file_type boolean parameter to symbols Puppet's boolean parameter type is only available in Puppet 3.3 and higher, so change file_type's new "replace" parameter to a regular parameter with true and false as possible values. This matches the existing "multiple" parameter. --- lib/puppet/provider/file_line/ruby.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/puppet/provider') diff --git a/lib/puppet/provider/file_line/ruby.rb b/lib/puppet/provider/file_line/ruby.rb index ea1d44d..d4cdfec 100644 --- a/lib/puppet/provider/file_line/ruby.rb +++ b/lib/puppet/provider/file_line/ruby.rb @@ -1,6 +1,6 @@ Puppet::Type.type(:file_line).provide(:ruby) do def exists? - if !resource[:replace] and count_matches(match_regex) > 0 + if resource[:replace].to_s != 'true' and count_matches(match_regex) > 0 true else lines.find do |line| @@ -10,7 +10,7 @@ Puppet::Type.type(:file_line).provide(:ruby) do end def create - unless !resource[:replace] and count_matches(match_regex) > 0 + unless resource[:replace].to_s != 'true' and count_matches(match_regex) > 0 if resource[:match] handle_create_with_match elsif resource[:after] -- cgit v1.2.3