summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2011-05-07 17:43:58 +0200
committerBrice Figureau <brice-puppet@daysofwonder.com>2011-05-07 17:43:58 +0200
commit37225200eb39af65dc9eeabb7ae3e6e7571fa602 (patch)
tree40495430f0f4ca5d4161b7cbc4f64a4350449752
parentb983386ece1b9816e6d3d59a316ad589e35773df (diff)
downloadpuppet-37225200eb39af65dc9eeabb7ae3e6e7571fa602.tar.gz
puppet-37225200eb39af65dc9eeabb7ae3e6e7571fa602.tar.xz
puppet-37225200eb39af65dc9eeabb7ae3e6e7571fa602.zip
Fix #7299 - do not require net/ssh for running rake spec
This is a different fix than the one proposed by Stefan Schulte, based on Luke comments. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
-rw-r--r--lib/puppet/util/network_device/transport/ssh.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/puppet/util/network_device/transport/ssh.rb b/lib/puppet/util/network_device/transport/ssh.rb
index bf0e7193c..3d7976543 100644
--- a/lib/puppet/util/network_device/transport/ssh.rb
+++ b/lib/puppet/util/network_device/transport/ssh.rb
@@ -2,7 +2,6 @@
require 'puppet/util/network_device'
require 'puppet/util/network_device/transport'
require 'puppet/util/network_device/transport/base'
-require 'net/ssh'
# This is an adaptation/simplification of gem net-ssh-telnet, which aims to have
# a sane interface to Net::SSH. Credits goes to net-ssh-telnet authors
@@ -12,6 +11,9 @@ class Puppet::Util::NetworkDevice::Transport::Ssh < Puppet::Util::NetworkDevice:
def initialize
super
+ unless Puppet.features.ssh?
+ raise 'Connecting with ssh to a network device requires the \'net/ssh\' ruby library'
+ end
end
def handles_login?