Exception: Chef::Exceptions::CookbookVersionSelection::InvalidRunListItems

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

Overview

Compound exception: In run_list expansion and resolution, run_list items referred to cookbooks that don't exist and/or have no versions available.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, non_existent_cookbooks, cookbooks_with_no_matching_versions) ⇒ InvalidRunListItems

Returns a new instance of InvalidRunListItems


337
338
339
340
341
342
# File 'lib/chef/exceptions.rb', line 337

def initialize(message, non_existent_cookbooks, cookbooks_with_no_matching_versions)
  super(message)

  @non_existent_cookbooks = non_existent_cookbooks
  @cookbooks_with_no_matching_versions = cookbooks_with_no_matching_versions
end

Instance Attribute Details

#cookbooks_with_no_matching_versionsObject (readonly)

Returns the value of attribute cookbooks_with_no_matching_versions


335
336
337
# File 'lib/chef/exceptions.rb', line 335

def cookbooks_with_no_matching_versions
  @cookbooks_with_no_matching_versions
end

#non_existent_cookbooksObject (readonly)

Returns the value of attribute non_existent_cookbooks


334
335
336
# File 'lib/chef/exceptions.rb', line 334

def non_existent_cookbooks
  @non_existent_cookbooks
end

Instance Method Details

#to_json(*a) ⇒ Object


344
345
346
347
348
349
350
351
# File 'lib/chef/exceptions.rb', line 344

def to_json(*a)
  result = {
    "message" => message,
    "non_existent_cookbooks" => non_existent_cookbooks,
    "cookbooks_with_no_versions" => cookbooks_with_no_matching_versions,
  }
  Chef::JSONCompat.to_json(result, *a)
end