Skip to content

Commit

Permalink
fix defaulted force behavior
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bmjen committed May 29, 2015
1 parent e9ee044 commit 64b9288
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/puppet/type/concat_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 64b9288

Please sign in to comment.