Commit 4b48e6bc authored by Chris Roberts's avatar Chris Roberts
Browse files

Append bin resource to the resource collection

This change will append to the resource collection instead of the
previous unshifting behavior. Covers issue raised by PR #5
parent a80c22bd
......@@ -23,9 +23,10 @@ class Chef
rescue Chef::Exceptions::ResourceNotFound
bin = Chef::Resource::DpkgAutostart.new('bin_file', context)
bin.action :create
current_resources = context.resource_collection.all_resources
[bin, current_resources].flatten.each_with_index do |res, i|
context.resource_collection[i] = res
if(context.resource_collection.respond_to?(:insert))
context.resource_collection.insert(bin)
else
context.resource_collection.push(bin)
end
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment