The previous commit left only one meaningful value for the method parameter of generate_additional_resources, making it a constant not a parameter. This commit removes it.
Paired-with: Jesse Wolfe Signed-off-by: Markus Roberts <mar...@reality.com> --- Local-branch: feature/next/resource_application_order lib/puppet/transaction.rb | 12 ++++++------ spec/unit/transaction_spec.rb | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb index aa0eec3..ad79f17 100644 --- a/lib/puppet/transaction.rb +++ b/lib/puppet/transaction.rb @@ -173,13 +173,13 @@ class Puppet::Transaction # A general method for recursively generating new resources from a # resource. - def generate_additional_resources(resource, method, presume_prefix_dependencies=false) - return [] unless resource.respond_to?(method) + def generate_additional_resources(resource) + return [] unless resource.respond_to?(:generate) begin - made = resource.send(method) + made = resource.generate rescue => detail puts detail.backtrace if Puppet[:trace] - resource.err "Failed to generate additional resources using '#{method}': #{detail}" + resource.err "Failed to generate additional resources using 'generate': #{detail}" end return [] unless made made = [made] unless made.is_a?(Array) @@ -189,7 +189,7 @@ class Puppet::Transaction @catalog.add_resource(res) res.finish make_parent_child_relationship(resource, res) - generate_additional_resources(res, method, presume_prefix_dependencies) + generate_additional_resources(res) true rescue Puppet::Resource::Catalog::DuplicateResourceError res.info "Duplicate generated resource; skipping" @@ -205,7 +205,7 @@ class Puppet::Transaction newlist = [] while ! list.empty? list.each do |resource| - newlist += generate_additional_resources(resource, :generate) + newlist += generate_additional_resources(resource) end list = newlist newlist = [] diff --git a/spec/unit/transaction_spec.rb b/spec/unit/transaction_spec.rb index 5867f2e..57bf800 100755 --- a/spec/unit/transaction_spec.rb +++ b/spec/unit/transaction_spec.rb @@ -197,7 +197,7 @@ describe Puppet::Transaction do second.expects(:generate).returns [third] third.expects(:generate) - @transaction.generate_additional_resources(first, :generate) + @transaction.generate_additional_resources(first) end it "should finish all resources" do @@ -213,7 +213,7 @@ describe Puppet::Transaction do resource.expects(:finish) - @transaction.generate_additional_resources(generator, :generate) + @transaction.generate_additional_resources(generator) end it "should skip generated resources that conflict with existing resources" do @@ -230,7 +230,7 @@ describe Puppet::Transaction do resource.expects(:finish).never resource.expects(:info) # log that it's skipped - @transaction.generate_additional_resources(generator, :generate).should be_empty + @transaction.generate_additional_resources(generator).should be_empty end it "should copy all tags to the newly generated resources" do @@ -247,7 +247,7 @@ describe Puppet::Transaction do child.expects(:finish) generator.expects(:depthfirst?) - @transaction.generate_additional_resources(generator, :generate) + @transaction.generate_additional_resources(generator) end end -- 1.7.0.4 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.