Don't error check the "exit" call to SSH

This commit is contained in:
Mitchell Hashimoto 2011-01-12 15:29:53 -08:00
parent 8482eeff0b
commit 55b7321f2b
1 changed files with 5 additions and 2 deletions

View File

@ -20,17 +20,20 @@ module Vagrant
def shell def shell
session.shell do |sh| session.shell do |sh|
sh.on_process_run do |sh, process| 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| process.on_finish do |p|
# By default when a process finishes we want to check the exit # By default when a process finishes we want to check the exit
# status so we can properly raise an exception # 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
end end
yield sh yield sh
# Exit and wait. We don't run shell commands in the background. # Exit and wait. We don't run shell commands in the background.
sh.execute "exit" sh.execute "exit", :error_check => false
sh.wait! sh.wait!
end end
end end