From 64b9288ac77ccfb51701845e0375690373c4419c Mon Sep 17 00:00:00 2001 From: Bryan Jen Date: Fri, 29 May 2015 09:09:07 -0700 Subject: [PATCH] fix defaulted force behavior With Concat 2.0.x we've deprecated the -force parameter and the resulting bug caused concat files that have no content/fragments to overwrite the target file with an empty file. Concat should only create an empty file if no file exists, and if the file exists, then it should not overwrite it with an empty file. --- lib/puppet/type/concat_file.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/puppet/type/concat_file.rb b/lib/puppet/type/concat_file.rb index 9b3fde4dc..0744fadd9 100644 --- a/lib/puppet/type/concat_file.rb +++ b/lib/puppet/type/concat_file.rb @@ -163,7 +163,11 @@ def generate end def eval_generate - catalog.resource("File[#{self[:path]}]")[:content] = should_content + content = should_content + + if !content.nil? and !content.empty? + catalog.resource("File[#{self[:path]}]")[:content] = content + end [] end end