From 5a2dc84fca2572aa6821e13eff44ecddc88965c2 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 24 Jan 2011 20:46:22 -0800 Subject: [PATCH] Fix possibility of options being nil in SSH class --- lib/vagrant/ssh/session.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/ssh/session.rb b/lib/vagrant/ssh/session.rb index 053dacf5a..022c427a2 100644 --- a/lib/vagrant/ssh/session.rb +++ b/lib/vagrant/ssh/session.rb @@ -55,8 +55,6 @@ module Vagrant # the actual `exec!` implementation, except that this # implementation also reports `:exit_status` to the block if given. def exec!(command, options=nil, &block) - options = { :error_check => true }.merge(options || {}) - retryable(:tries => 5, :on => IOError, :sleep => 0.5) do metach = session.open_channel do |channel| channel.exec(command) do |ch, success| @@ -73,6 +71,8 @@ module Vagrant # Sets up the channel callbacks to properly check exit statuses and # callback on stdout/stderr. def setup_channel_callbacks(channel, command, options, block) + options = { :error_check => true }.merge(options || {}) + block ||= Proc.new do |ch, type, data| check_exit_status(data, command, options) if type == :exit_status && options[:error_check]