lib/fog/joyent/compute.rb in fog-1.35.0 vs lib/fog/joyent/compute.rb in fog-1.36.0

- old
+ new

@@ -1,8 +1,7 @@ require 'fog/joyent/core' require 'fog/joyent/errors' -require 'net/ssh' module Fog module Compute class Joyent < Fog::Service requires :joyent_username @@ -124,9 +123,15 @@ unless @joyent_username raise ArgumentError, "options[:joyent_username] required" end if options[:joyent_keyname] + begin + require "net/ssh" + rescue LoadError + Fog::Logger.warning("'net/ssh' missing, please install and try again.") + exit(1) + end @joyent_keyname = options[:joyent_keyname] @joyent_keyphrase = options[:joyent_keyphrase] @key_manager = Net::SSH::Authentication::KeyManager.new(nil, { :keys_only => true, :passphrase => @joyent_keyphrase