diff options
Diffstat (limited to 'lib/chef/chef_fs/file_system/multiplexed_dir.rb')
-rw-r--r-- | lib/chef/chef_fs/file_system/multiplexed_dir.rb | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/chef/chef_fs/file_system/multiplexed_dir.rb b/lib/chef/chef_fs/file_system/multiplexed_dir.rb index 21abc012f8..cf1fb34345 100644 --- a/lib/chef/chef_fs/file_system/multiplexed_dir.rb +++ b/lib/chef/chef_fs/file_system/multiplexed_dir.rb @@ -17,22 +17,20 @@ class Chef end def children - begin - result = [] - seen = {} + result = [] + seen = {} # If multiple things have the same name, the first one wins. - multiplexed_dirs.each do |dir| - dir.children.each do |child| - if seen[child.name] - Chef::Log.warn("Child with name '#{child.name}' found in multiple directories: #{seen[child.name].path_for_printing} and #{child.path_for_printing}") unless seen[child.name].path_for_printing == child.path_for_printing - else - result << child - seen[child.name] = child - end + multiplexed_dirs.each do |dir| + dir.children.each do |child| + if seen[child.name] + Chef::Log.warn("Child with name '#{child.name}' found in multiple directories: #{seen[child.name].path_for_printing} and #{child.path_for_printing}") unless seen[child.name].path_for_printing == child.path_for_printing + else + result << child + seen[child.name] = child end end - result end + result end def make_child_entry(name) |