lib/chef_sync/knife.rb
def parse_output(command, args, output)
			stdout, stderr, status = output

			begin
				return JSON.parse(stdout)
			#Assuming here that a parser error means no data was returned and there was a knife error.
			rescue JSON::ParserError => e
				puts "Received STDERR #{stderr} when trying to run knife_capture(#{command}, #{args})."
				return stdout
			end
		end
#Need to extend Chef::Knife::API in this class because knife_capture is top-level.
Need to extend Chef::Knife::API in this class because knife_capture is top-level.
Need to extend Chef :: Knife :: API in this class because knife_capture is top - level .
def parse_output(command, args, output)
			stdout, stderr, status = output
			begin
				return JSON.parse(stdout)
			rescue JSON::ParserError => e
				puts "Received STDERR #{stderr} when trying to run knife_capture(#{command}, #{args})."
				return stdout
			end
		end
def parse_output ( command , args , output ) stdout , stderr , status = output begin return JSON . parse ( stdout ) rescue JSON :: ParserError => e puts "Received STDERR #{stderr} when trying to run knife_capture(#{command}, #{args})." return stdout end end
Need to extend Chef::Knife::API in this class because knife_capture is top-level.
Need to extend Chef :: Knife :: API in this class because knife_capture is top - level .
#Assuming here that a parser error means no data was returned and there was a knife error.
command
args
output