def cook
cmd = "sudo chef-solo -c #{provisioning_path}/solo.rb -j #{provisioning_path}/dna.json"
cmd << " -l debug" if debug?
cmd << " -N #{config[:chef_node_name]}" if config[:chef_node_name]
cmd << " -W" if config[:why_run]
cmd << " -o #{config[:override_runlist]}" if config[:override_runlist]
if Gem::Version.new(::Chef::VERSION) >= Gem::Version.new("12.10.54")
cmd << " --legacy-mode" if config[:legacy_mode]
end
ui.msg "Running Chef: #{cmd}"
result = stream_command cmd
raise "chef-solo failed. See output above." unless result.success?
end