Module: KnifeCookbookDependencies::KnifeUtils

Defined in:
lib/kcd/knife_utils.rb

Class Method Summary collapse

Class Method Details

.capture_knife_output(knife_obj) ⇒ Object



6
7
8
9
10
11
# File 'lib/kcd/knife_utils.rb', line 6

def self.capture_knife_output(knife_obj)
  knife_obj.ui = Chef::Knife::UI.new(StringIO.new, StringIO.new, StringIO.new, :format => :json)
  knife_obj.run
  knife_obj.ui.stdout.rewind
  knife_obj.ui.stdout.read
end