We don't need net-ssh-shell after all
This commit is contained in:
parent
2a5070dad7
commit
547996e506
1
Gemfile
1
Gemfile
|
@ -5,7 +5,6 @@ gem "vagrant", :path => '.'
|
||||||
# Use the following gems straight from git, since Vagrant dev
|
# Use the following gems straight from git, since Vagrant dev
|
||||||
# typically coincides with it
|
# typically coincides with it
|
||||||
gem "virtualbox", :git => "git://github.com/mitchellh/virtualbox.git"
|
gem "virtualbox", :git => "git://github.com/mitchellh/virtualbox.git"
|
||||||
gem "net-ssh-shell", :git => "git://github.com/mitchellh/net-ssh-shell.git"
|
|
||||||
|
|
||||||
# Gems required for testing only. To install run
|
# Gems required for testing only. To install run
|
||||||
# gem bundle test
|
# gem bundle test
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
require 'timeout'
|
require 'timeout'
|
||||||
require 'net/ssh'
|
require 'net/ssh'
|
||||||
require 'net/ssh/shell'
|
|
||||||
require 'net/scp'
|
require 'net/scp'
|
||||||
require 'mario'
|
require 'mario'
|
||||||
|
|
||||||
|
|
|
@ -12,32 +12,6 @@ module Vagrant
|
||||||
@session = session
|
@session = session
|
||||||
end
|
end
|
||||||
|
|
||||||
# Opens a shell with this SSH session, which forces things like the
|
|
||||||
# `/etc/profile` script to load, and for state to exist between commands,
|
|
||||||
# and so on. The overhead on this is much higher than simply calling
|
|
||||||
# {#exec!} and should really only be called when settings for the terminal
|
|
||||||
# may be needed (for things such as a PATH modifications and so on).
|
|
||||||
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) if p.properties[:error_check]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
yield sh
|
|
||||||
|
|
||||||
# Exit and wait. We don't run shell commands in the background.
|
|
||||||
sh.execute "exit", :error_check => false
|
|
||||||
sh.wait!
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Executes a given command and simply returns true/false if the
|
# Executes a given command and simply returns true/false if the
|
||||||
# command succeeded or not.
|
# command succeeded or not.
|
||||||
def test?(command)
|
def test?(command)
|
||||||
|
|
|
@ -19,7 +19,6 @@ Gem::Specification.new do |s|
|
||||||
s.add_dependency "json", "~> 1.4.6"
|
s.add_dependency "json", "~> 1.4.6"
|
||||||
s.add_dependency "mario", "~> 0.0.6"
|
s.add_dependency "mario", "~> 0.0.6"
|
||||||
s.add_dependency "net-ssh", "~> 2.0.23"
|
s.add_dependency "net-ssh", "~> 2.0.23"
|
||||||
s.add_dependency "net-ssh-shell", "~> 0.2.0"
|
|
||||||
s.add_dependency "net-scp", "~> 1.0.4"
|
s.add_dependency "net-scp", "~> 1.0.4"
|
||||||
s.add_dependency "i18n", "~> 0.5.0"
|
s.add_dependency "i18n", "~> 0.5.0"
|
||||||
s.add_dependency "thor", "~> 0.14.6"
|
s.add_dependency "thor", "~> 0.14.6"
|
||||||
|
|
Loading…
Reference in New Issue