Exception: Chef::Exceptions::CookbookChefVersionMismatch

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

Instance Method Summary collapse

Constructor Details

#initialize(chef_version, cookbook_name, cookbook_version, *constraints) ⇒ CookbookChefVersionMismatch

Returns a new instance of CookbookChefVersionMismatch.



476
477
478
479
# File 'lib/chef/exceptions.rb', line 476

def initialize(chef_version, cookbook_name, cookbook_version, *constraints)
  constraint_str = constraints.map { |c| c.requirement.as_list.to_s }.join(", ")
  super "Cookbook '#{cookbook_name}' version '#{cookbook_version}' depends on chef version #{constraint_str}, but the running chef version is #{chef_version}"
end