Skip to content

Commit

Permalink
Merge pull request #330 from duritong/fix_autorequire
Browse files Browse the repository at this point in the history
(MODULES-2023) - autorequire the file we are generating
  • Loading branch information
bmjen committed Jun 4, 2015
2 parents 8d7d427 + 09a380c commit 724dcaa
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions lib/puppet/type/concat_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,9 @@ def exists?
end.compact
end

# Copied from puppet's file type
# Autorequire the nearest ancestor directory found in the catalog.
# Autorequire the file we are generating below
autorequire(:file) do
req = []
path = Pathname.new(self[:path])
if !path.root?
# Start at our parent, to avoid autorequiring ourself
parents = path.parent.enum_for(:ascend)
if found = parents.find { |p| catalog.resource(:file, p.to_s) }
req << found.to_s
end
end

req
[self[:path]]
end

def should_content
Expand Down

0 comments on commit 724dcaa

Please sign in to comment.