Use symbol as a hash key for subprocess. Guarantees we always get a string back.

This commit is contained in:
Mitchell Hashimoto 2012-01-19 17:24:22 -08:00
parent 527b79853c
commit 3f3476f323
1 changed files with 5 additions and 5 deletions

View File

@ -69,7 +69,7 @@ module Vagrant
stderr_writer.close
# Create a dictionary to store all the output we see.
io_data = { stdout => "", stderr => "" }
io_data = { :stdout => "", :stderr => "" }
# Record the start time for timeout purposes
start_time = Time.now.to_i
@ -94,7 +94,7 @@ module Vagrant
io_name = r == stdout ? :stdout : :stderr
@logger.debug("#{io_name}: #{data}")
io_data[r] += data
io_data[io_name] += data
yield io_name, data if block_given?
end
end
@ -133,15 +133,15 @@ module Vagrant
# Log it out and accumulate
@logger.debug(extra_data)
io_data[io] += extra_data
io_name = io == stdout ? :stdout : :stderr
io_data[io_name] += extra_data
# Yield to any listeners any remaining data
io_name = io == stdout ? :stdout : :stderr
yield io_name, extra_data if block_given?
end
# Return an exit status container
return Result.new(process.exit_code, io_data[stdout], io_data[stderr])
return Result.new(process.exit_code, io_data[:stdout], io_data[:stderr])
end
protected