Exception: Chef::Exceptions::MultipleDscResourcesFound

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/chef/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resources_found) ⇒ MultipleDscResourcesFound

Returns a new instance of MultipleDscResourcesFound.



448
449
450
451
452
453
454
455
456
457
458
# File 'lib/chef/exceptions.rb', line 448

def initialize(resources_found)
  @resources_found = resources_found
  matches_info = @resources_found.each do |r|
    if r['Module'].nil?
      "Resource #{r['Name']} was found in #{r['Module']['Name']}"
    else
      "Resource #{r['Name']} is a binary resource"
    end
  end
  super "Found multiple matching resources. #{matches_info.join("\n")}"
end

Instance Attribute Details

#resources_foundObject (readonly)

Returns the value of attribute resources_found.



447
448
449
# File 'lib/chef/exceptions.rb', line 447

def resources_found
  @resources_found
end