lib/fog/joyent/compute.rb in fog-1.22.0 vs lib/fog/joyent/compute.rb in fog-1.22.1

- old
+ new

@@ -3,11 +3,10 @@ require 'net/ssh' module Fog module Compute class Joyent < Fog::Service - requires :joyent_username recognizes :joyent_password recognizes :joyent_url @@ -113,11 +112,10 @@ class Real attr_accessor :joyent_version attr_accessor :joyent_url def initialize(options = {}) - @connection_options = options[:connection_options] || {} @persistent = options[:persistent] || false @joyent_url = options[:joyent_url] || 'https://us-sw-1.api.joyentcloud.com' @joyent_version = options[:joyent_version] || '~6.5' @@ -135,11 +133,11 @@ :passphrase => @joyent_keyphrase }) @header_method = method(:header_for_signature_auth) if options[:joyent_keyfile] - if File.exists?(options[:joyent_keyfile]) + if File.exist?(options[:joyent_keyfile]) @joyent_keyfile = options[:joyent_keyfile] @key_manager.add(@joyent_keyfile) else raise ArgumentError, "options[:joyent_keyfile] provided does not exist." end @@ -174,11 +172,10 @@ if opts[:body] opts[:body] = Fog::JSON.encode(opts[:body]) end - response = @connection.request(opts) if response.headers["Content-Type"] == "application/json" response.body = json_decode(response.body) end @@ -272,10 +269,9 @@ raise Joyent::Errors::RetryWith.new('Invalid API Version requested; try with a different API Version', request, response) when 503 then raise Joyent::Errors::ServiceUnavailable.new('Either there\'s no capacity in this datacenter, or we\'re in a maintenance window', request, response) end end - end # Real end end end