From 1cf379a1f0f014cacf5ab531d5561b7bc927585b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 9 Jul 2011 11:21:37 -0700 Subject: [PATCH] Be smart about loading files in Vagrant::SSH --- lib/vagrant/ssh.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/ssh.rb b/lib/vagrant/ssh.rb index 3cc1656e6..8688544b8 100644 --- a/lib/vagrant/ssh.rb +++ b/lib/vagrant/ssh.rb @@ -1,15 +1,16 @@ -require 'timeout' require 'net/ssh' require 'net/scp' require 'mario' -require 'vagrant/ssh/session' - module Vagrant # Manages SSH access to a specific environment. Allows an environment to # replace the process with SSH itself, run a specific set of commands, # upload files, or even check if a host is up. class SSH + # Autoload this guy because he is really only used in one location + # and not for every Vagrant command. + autoload :Session, 'vagrant/ssh/session' + include Util::Retryable # Reference back up to the environment which this SSH object belongs @@ -119,6 +120,7 @@ module Vagrant # Windows ssh_port = port + require 'timeout' Timeout.timeout(env.config.ssh.timeout) do execute(:timeout => env.config.ssh.timeout, :port => ssh_port) { |ssh| }