Skip to content

Commit 64b9288

Browse files
committed
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.
1 parent e9ee044 commit 64b9288

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/puppet/type/concat_file.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ def generate
163163
end
164164
165165
def eval_generate
166-
catalog.resource("File[#{self[:path]}]")[:content] = should_content
166+
content = should_content
167+
168+
if !content.nil? and !content.empty?
169+
catalog.resource("File[#{self[:path]}]")[:content] = content
170+
end
167171
[]
168172
end
169173
end

0 commit comments

Comments
 (0)