Exception: Chef::Exceptions::CookbookOhaiVersionMismatch

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

Instance Method Summary collapse

Constructor Details

#initialize(ohai_version, cookbook_name, cookbook_version, *constraints) ⇒ CookbookOhaiVersionMismatch


501
502
503
504
# File 'lib/chef/exceptions.rb', line 501

def initialize(ohai_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 ohai version #{constraint_str}, but the running ohai version is #{ohai_version}"
end