From 55b7321f2b417cd17ba3986a83c39ee957992e15 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 12 Jan 2011 15:29:53 -0800 Subject: [PATCH] Don't error check the "exit" call to SSH --- lib/vagrant/ssh/session.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/ssh/session.rb b/lib/vagrant/ssh/session.rb index d5a138de8..150437a68 100644 --- a/lib/vagrant/ssh/session.rb +++ b/lib/vagrant/ssh/session.rb @@ -20,17 +20,20 @@ module Vagrant def shell session.shell do |sh| sh.on_process_run do |sh, process| + # Enable error checking by default + process.properties[:error_check] = true if !process.properties.has_key?(:error_check) + process.on_finish do |p| # By default when a process finishes we want to check the exit # status so we can properly raise an exception - self.check_exit_status(p.exit_status, p.command, p.properties) + self.check_exit_status(p.exit_status, p.command, p.properties) if p.properties[:error_check] end end yield sh # Exit and wait. We don't run shell commands in the background. - sh.execute "exit" + sh.execute "exit", :error_check => false sh.wait! end end