class Pantry::Chef::RunChefSolo

Execute ChefSolo on the current box, returning STDOUT, STDERR, and status code.

Public Instance Methods

perform(message) click to toggle source
# File lib/pantry/chef/run_chef_solo.rb, line 7
def perform(message)
  begin
    solo_rb = Pantry.root.join("etc", "chef", "solo.rb")
    stdout, stderr, status = Open3.capture3("chef-solo --config #{solo_rb}")
    [stdout, stderr, status.to_i]
  rescue Exception => e
    # Could not find the chef-solo binary
    ["", e.message, 1]
  end
end