[core] pass connection_options through service init

closes #411
This commit is contained in:
geemus 2011-09-12 10:01:48 -05:00
parent 544ae281eb
commit ffd01e51dd
41 changed files with 256 additions and 194 deletions

View File

@ -75,6 +75,7 @@ module Fog
@aws_secret_access_key = options[:aws_secret_access_key] @aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
@connection_options = options[:connection_options] || {}
options[:region] ||= 'us-east-1' options[:region] ||= 'us-east-1'
@host = options[:host] || case options[:region] @host = options[:host] || case options[:region]
when 'ap-northeast-1' when 'ap-northeast-1'
@ -90,10 +91,11 @@ module Fog
else else
raise ArgumentError, "Unknown region: #{options[:region].inspect}" raise ArgumentError, "Unknown region: #{options[:region].inspect}"
end end
@path = options[:path] || '/' @path = options[:path] || '/'
@port = options[:port] || 443 @port = options[:port] || 443
@scheme = options[:scheme] || 'https' @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]) @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -84,16 +84,15 @@ module Fog
@aws_access_key_id = options[:aws_access_key_id] @aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key] @aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha1', @aws_secret_access_key) @connection_options = options[:connection_options] || {}
@host = options[:host] || 'cloudfront.amazonaws.com' @hmac = Fog::HMAC.new('sha1', @aws_secret_access_key)
@path = options[:path] || '/' @host = options[:host] || 'cloudfront.amazonaws.com'
@port = options[:port] || 443 @path = options[:path] || '/'
@scheme = options[:scheme] || 'https' @persistent = options[:persistent] || true
@version = options[:version] || '2010-11-01' @port = options[:port] || 443
unless options.has_key?(:persistent) @scheme = options[:scheme] || 'https'
options[:persistent] = true @version = options[:version] || '2010-11-01'
end @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent])
end end
def reload def reload

View File

@ -51,6 +51,7 @@ module Fog
@aws_secret_access_key = options[:aws_secret_access_key] @aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
@connection_options = options[:connection_options] || {}
options[:region] ||= 'us-east-1' options[:region] ||= 'us-east-1'
@host = options[:host] || case options[:region] @host = options[:host] || case options[:region]
when 'ap-northeast-1' when 'ap-northeast-1'
@ -66,10 +67,11 @@ module Fog
else else
raise ArgumentError, "Unknown region: #{options[:region].inspect}" raise ArgumentError, "Unknown region: #{options[:region].inspect}"
end end
@path = options[:path] || '/' @path = options[:path] || '/'
@port = options[:port] || 443 @persistent = options[:persistent] || false
@scheme = options[:scheme] || 'https' @port = options[:port] || 443
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]) @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -52,6 +52,7 @@ module Fog
@aws_secret_access_key = options[:aws_secret_access_key] @aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
@connection_options = options[:connection_options] || {}
options[:region] ||= 'us-east-1' options[:region] ||= 'us-east-1'
@host = options[:host] || case options[:region] @host = options[:host] || case options[:region]
when 'ap-northeast-1' when 'ap-northeast-1'
@ -67,10 +68,11 @@ module Fog
else else
raise ArgumentError, "Unknown region: #{options[:region].inspect}" raise ArgumentError, "Unknown region: #{options[:region].inspect}"
end end
@path = options[:path] || '/' @path = options[:path] || '/'
@port = options[:port] || 443 @persistent = options[:persistent] || false
@scheme = options[:scheme] || 'https' @port = options[:port] || 443
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]) @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -226,8 +226,9 @@ module Fog
@aws_access_key_id = options[:aws_access_key_id] @aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key] @aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) @connection_options = options[:connection_options] || {}
@region = options[:region] ||= 'us-east-1' @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
@region = options[:region] ||= 'us-east-1'
if @endpoint = options[:endpoint] if @endpoint = options[:endpoint]
endpoint = URI.parse(@endpoint) endpoint = URI.parse(@endpoint)
@ -250,11 +251,12 @@ module Fog
else else
raise ArgumentError, "Unknown region: #{options[:region].inspect}" raise ArgumentError, "Unknown region: #{options[:region].inspect}"
end end
@path = options[:path] || '/' @path = options[:path] || '/'
@port = options[:port] || 443 @persistent = options[:persistent] || false
@scheme = options[:scheme] || 'https' @port = options[:port] || 443
@scheme = options[:scheme] || 'https'
end end
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]) @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -80,18 +80,18 @@ module Fog
def initialize(options={}) def initialize(options={})
require 'fog/core/parser' require 'fog/core/parser'
@aws_access_key_id = options[:aws_access_key_id] @aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key] @aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha1', @aws_secret_access_key) @connection_options = options[:connection_options] || {}
@host = options[:host] || 'route53.amazonaws.com' @hmac = Fog::HMAC.new('sha1', @aws_secret_access_key)
@path = options[:path] || '/' @host = options[:host] || 'route53.amazonaws.com'
@port = options[:port] || 443 @path = options[:path] || '/'
@scheme = options[:scheme] || 'https' @persistent = options[:persistent] || true
@version = options[:version] || '2010-10-01' @port = options[:port] || 443
unless options.has_key?(:persistent) @scheme = options[:scheme] || 'https'
options[:persistent] = true @version = options[:version] || '2010-10-01'
end
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]) @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -103,6 +103,7 @@ module Fog
@aws_access_key_id = options[:aws_access_key_id] @aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key] @aws_secret_access_key = options[:aws_secret_access_key]
@connection_options = options[:connection_options] || {}
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
options[:region] ||= 'us-east-1' options[:region] ||= 'us-east-1'
@ -120,10 +121,11 @@ module Fog
else else
raise ArgumentError, "Unknown region: #{options[:region].inspect}" raise ArgumentError, "Unknown region: #{options[:region].inspect}"
end end
@path = options[:path] || '/' @path = options[:path] || '/'
@port = options[:port] || 443 @persistent = options[:persistent] || false
@scheme = options[:scheme] || 'https' @port = options[:port] || 443
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]) @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -112,12 +112,14 @@ module Fog
@aws_access_key_id = options[:aws_access_key_id] @aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key] @aws_secret_access_key = options[:aws_secret_access_key]
@connection_options = options[:connection_options] || {}
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
@host = options[:host] || 'iam.amazonaws.com' @host = options[:host] || 'iam.amazonaws.com'
@path = options[:path] || '/' @path = options[:path] || '/'
@port = options[:port] || 443 @persistent = options[:persistent] || false
@scheme = options[:scheme] || 'https' @port = options[:port] || 443
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]) @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -86,6 +86,7 @@ module Fog
def initialize(options={}) def initialize(options={})
@aws_access_key_id = options[:aws_access_key_id] @aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key] @aws_secret_access_key = options[:aws_secret_access_key]
@connection_options = options[:connection_options] || {}
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
options[:region] ||= 'us-east-1' options[:region] ||= 'us-east-1'
@ -103,10 +104,11 @@ module Fog
else else
raise ArgumentError, "Unknown region: #{options[:region].inspect}" raise ArgumentError, "Unknown region: #{options[:region].inspect}"
end end
@path = options[:path] || '/' @path = options[:path] || '/'
@port = options[:port] || 443 @persistent = options[:persistent] || false
@scheme = options[:scheme] || 'https' @port = options[:port] || 443
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]) @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -49,6 +49,7 @@ module Fog
@aws_access_key_id = options[:aws_access_key_id] @aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key] @aws_secret_access_key = options[:aws_secret_access_key]
@connection_options = options[:connection_options] || {}
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
options[:region] ||= 'us-east-1' options[:region] ||= 'us-east-1'
@host = options[:host] || case options[:region] @host = options[:host] || case options[:region]
@ -57,10 +58,11 @@ module Fog
else else
raise ArgumentError, "Unknown region: #{options[:region].inspect}" raise ArgumentError, "Unknown region: #{options[:region].inspect}"
end end
@path = options[:path] || '/' @path = options[:path] || '/'
@port = options[:port] || 443 @persistent = options[:persistent] || false
@scheme = options[:scheme] || 'https' @port = options[:port] || 443
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]) @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -70,6 +70,7 @@ module Fog
@aws_access_key_id = options[:aws_access_key_id] @aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key] @aws_secret_access_key = options[:aws_secret_access_key]
@connection_options = options[:connection_options] || {}
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
@nil_string = options[:nil_string]|| 'nil' @nil_string = options[:nil_string]|| 'nil'
@ -88,10 +89,11 @@ module Fog
else else
raise ArgumentError, "Unknown region: #{options[:region].inspect}" raise ArgumentError, "Unknown region: #{options[:region].inspect}"
end end
@path = options[:path] || '/' @path = options[:path] || '/'
@port = options[:port] || 443 @persistent = options[:persistent] || false
@scheme = options[:scheme] || 'https' @port = options[:port] || 443
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]) @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
private private

View File

@ -52,6 +52,7 @@ module Fog
require 'multi_json' require 'multi_json'
@aws_access_key_id = options[:aws_access_key_id] @aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key] @aws_secret_access_key = options[:aws_secret_access_key]
@connection_options = options[:connection_options] || {}
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
options[:region] ||= 'us-east-1' options[:region] ||= 'us-east-1'
@ -68,10 +69,11 @@ module Fog
raise ArgumentError, "Unknown region: #{options[:region].inspect}" raise ArgumentError, "Unknown region: #{options[:region].inspect}"
end end
@path = options[:path] || '/' @path = options[:path] || '/'
@port = options[:port] || 443 @persistent = options[:persistent] || false
@scheme = options[:scheme] || 'https' @port = options[:port] || 443
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]) @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -48,6 +48,7 @@ module Fog
def initialize(options={}) def initialize(options={})
@aws_access_key_id = options[:aws_access_key_id] @aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key] @aws_secret_access_key = options[:aws_secret_access_key]
@connection_options = options[:connection_options] || {}
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
options[:region] ||= 'us-east-1' options[:region] ||= 'us-east-1'
@host = options[:host] || case options[:region] @host = options[:host] || case options[:region]
@ -62,10 +63,11 @@ module Fog
else else
raise ArgumentError, "Unknown region: #{options[:region].inspect}" raise ArgumentError, "Unknown region: #{options[:region].inspect}"
end end
@path = options[:path] || '/' @path = options[:path] || '/'
@port = options[:port] || 443 @persistent = options[:persistent] || false
@scheme = options[:scheme] || 'https' @port = options[:port] || 443
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]) @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -245,6 +245,7 @@ module Fog
@aws_access_key_id = options[:aws_access_key_id] @aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key] @aws_secret_access_key = options[:aws_secret_access_key]
@connection_options = options[:connection_options] || {}
@hmac = Fog::HMAC.new('sha1', @aws_secret_access_key) @hmac = Fog::HMAC.new('sha1', @aws_secret_access_key)
if @endpoint = options[:endpoint] if @endpoint = options[:endpoint]
endpoint = URI.parse(@endpoint) endpoint = URI.parse(@endpoint)
@ -268,14 +269,12 @@ module Fog
else else
raise ArgumentError, "Unknown region: #{options[:region].inspect}" raise ArgumentError, "Unknown region: #{options[:region].inspect}"
end end
@path = options[:path] || '/' @path = options[:path] || '/'
@port = options[:port] || 443 @persistent = options[:persistent] || true
@scheme = options[:scheme] || 'https' @port = options[:port] || 443
unless options.has_key?(:persistent) @scheme = options[:scheme] || 'https'
options[:persistent] = true
end
end end
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]) @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload
@ -368,7 +367,7 @@ DATA
rescue Excon::Errors::TemporaryRedirect => error rescue Excon::Errors::TemporaryRedirect => error
uri = URI.parse(error.response.headers['Location']) uri = URI.parse(error.response.headers['Location'])
Fog::Logger.warning("fog: followed redirect to #{uri.host}, connecting to the matching region will be more performant") Fog::Logger.warning("fog: followed redirect to #{uri.host}, connecting to the matching region will be more performant")
response = Fog::Connection.new("#{@scheme}://#{uri.host}:#{@port}", false).request(original_params, &block) response = Fog::Connection.new("#{@scheme}://#{uri.host}:#{@port}", false, @connection_options).request(original_params, &block)
end end
response response

View File

@ -61,10 +61,12 @@ module Fog
require 'multi_json' require 'multi_json'
@bluebox_api_key = options[:bluebox_api_key] @bluebox_api_key = options[:bluebox_api_key]
@bluebox_customer_id = options[:bluebox_customer_id] @bluebox_customer_id = options[:bluebox_customer_id]
@host = options[:bluebox_host] || "boxpanel.bluebox.net" @connection_options = options[:connection_options] || {}
@port = options[:bluebox_port] || 443 @host = options[:bluebox_host] || "boxpanel.bluebox.net"
@scheme = options[:bluebox_scheme] || 'https' @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @port = options[:bluebox_port] || 443
@scheme = options[:bluebox_scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -55,11 +55,12 @@ module Fog
def initialize(options ={}) def initialize(options ={})
@bluebox_customer_id = options[:bluebox_customer_id] @bluebox_customer_id = options[:bluebox_customer_id]
@bluebox_api_key = options[:bluebox_api_key] @bluebox_api_key = options[:bluebox_api_key]
@connection_options = options[:connection_options] || {}
@host = options[:bluebox_host] || "boxpanel.bluebox.net" @host = options[:bluebox_host] || "boxpanel.bluebox.net"
@port = options[:bluebox_port] || 443 @persistent = options[:persistent] || false
@scheme = options[:bluebox_scheme] || 'https' @port = options[:bluebox_port] || 443
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @scheme = options[:bluebox_scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -101,11 +101,13 @@ module Fog
def initialize(options) def initialize(options)
require 'multi_json' require 'multi_json'
# Currently authentication and api endpoints are the same but may change # Currently authentication and api endpoints are the same but may change
@auth_url = options[:brightbox_auth_url] || Fog.credentials[:brightbox_auth_url] || API_URL @auth_url = options[:brightbox_auth_url] || Fog.credentials[:brightbox_auth_url] || API_URL
@api_url = options[:brightbox_api_url] || Fog.credentials[:brightbox_api_url] || API_URL @api_url = options[:brightbox_api_url] || Fog.credentials[:brightbox_api_url] || API_URL
@brightbox_client_id = options[:brightbox_client_id] || Fog.credentials[:brightbox_client_id] @connection_options = options[:connection_options] || {}
@brightbox_secret = options[:brightbox_secret] || Fog.credentials[:brightbox_secret] @brightbox_client_id = options[:brightbox_client_id] || Fog.credentials[:brightbox_client_id]
@connection = Fog::Connection.new(@api_url) @brightbox_secret = options[:brightbox_secret] || Fog.credentials[:brightbox_secret]
@persistent = options[:peristent] || false
@connection = Fog::Connection.new(@api_url, @persistent, @connection_options)
end end
def request(method, url, expected_responses, options = nil) def request(method, url, expected_responses, options = nil)

View File

@ -59,16 +59,18 @@ module Fog
@dnsimple_email = options[:dnsimple_email] @dnsimple_email = options[:dnsimple_email]
@dnsimple_password = options[:dnsimple_password] @dnsimple_password = options[:dnsimple_password]
@connection_options = options[:connection_options] || {}
if options[:dnsimple_url] if options[:dnsimple_url]
uri = URI.parse(options[:dnsimple_url]) uri = URI.parse(options[:dnsimple_url])
options[:host] = uri.host options[:host] = uri.host
options[:port] = uri.port options[:port] = uri.port
options[:scheme] = uri.scheme options[:scheme] = uri.scheme
end end
@host = options[:host] || "dnsimple.com" @host = options[:host] || "dnsimple.com"
@port = options[:port] || 443 @persistent = options[:persistent] || false
@scheme = options[:scheme] || 'https' @port = options[:port] || 443
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -84,13 +84,12 @@ module Fog
@dnsmadeeasy_api_key = options[:dnsmadeeasy_api_key] @dnsmadeeasy_api_key = options[:dnsmadeeasy_api_key]
@dnsmadeeasy_secret_key = options[:dnsmadeeasy_secret_key] @dnsmadeeasy_secret_key = options[:dnsmadeeasy_secret_key]
@host = options[:host] || 'api.dnsmadeeasy.com' @connection_options = options[:connection_options] || {}
@port = options[:port] || 80 #443 Not yet @host = options[:host] || 'api.dnsmadeeasy.com'
@scheme = options[:scheme] || 'http' #'https Not yet @persistent = options[:persistent] || true
unless options.has_key?(:persistent) @port = options[:port] || 80 #443 Not yet
options[:persistent] = true @scheme = options[:scheme] || 'http' #'https Not yet
end @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
end end
def reload def reload

View File

@ -64,12 +64,14 @@ module Fog
@dynect_username = options[:dynect_username] @dynect_username = options[:dynect_username]
@dynect_password = options[:dynect_password] @dynect_password = options[:dynect_password]
@host = "api2.dynect.net" @connection_options = options[:connection_options] || {}
@port = options[:port] || 443 @host = "api2.dynect.net"
@path = options[:path] || '/REST' @port = options[:port] || 443
@scheme = options[:scheme] || 'https' @path = options[:path] || '/REST'
@version = options[:version] || '2.3.1' @persistent = options[:persistent] || true
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent] || true) @scheme = options[:scheme] || 'https'
@version = options[:version] || '2.3.1'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def auth_token def auth_token

View File

@ -1144,11 +1144,12 @@ module Fog
require 'fog/core/parser' require 'fog/core/parser'
@connections = {} @connections = {}
@connection_options = options[:connection_options] || {}
@versions_uri = URI.parse(options[:ecloud_versions_uri]) @versions_uri = URI.parse(options[:ecloud_versions_uri])
@version = options[:ecloud_version] @version = options[:ecloud_version]
@username = options[:ecloud_username] @username = options[:ecloud_username]
@password = options[:ecloud_password] @password = options[:ecloud_password]
@persistent = options[:persistent] @persistent = options[:persistent] || false
end end
def default_organization_uri def default_organization_uri
@ -1268,7 +1269,7 @@ module Fog
# Hash connections on the host_url ... There's nothing to say we won't get URI's that go to # Hash connections on the host_url ... There's nothing to say we won't get URI's that go to
# different hosts. # different hosts.
@connections[host_url] ||= Fog::Connection.new(host_url, @persistent) @connections[host_url] ||= Fog::Connection.new(host_url, @persistent, @connection_options)
# Set headers to an empty hash if none are set. # Set headers to an empty hash if none are set.
headers = params[:headers] || {} headers = params[:headers] || {}

View File

@ -52,10 +52,12 @@ module Fog
require 'multi_json' require 'multi_json'
require 'base64' require 'base64'
@api_url = options[:glesys_api_url] || Fog.credentials[:glesys_api_url] || API_URL @api_url = options[:glesys_api_url] || Fog.credentials[:glesys_api_url] || API_URL
@glesys_username = options[:glesys_username] || Fog.credentials[:glesys_api_key] @glesys_username = options[:glesys_username] || Fog.credentials[:glesys_api_key]
@glesys_api_key = options[:glesys_api_key] || Fog.credentials[:glesys_api_key] @glesys_api_key = options[:glesys_api_key] || Fog.credentials[:glesys_api_key]
@connection = Fog::Connection.new(@api_url) @connection_options = options[:connection_options] || {}
@persistent = options[:persistent] || false
@connection = Fog::Connection.new(@api_url, @persistent, @connection_options)
end end
def request(method_name, options = {}) def request(method_name, options = {})

View File

@ -64,11 +64,13 @@ module Fog
require 'multi_json' require 'multi_json'
@go_grid_api_key = options[:go_grid_api_key] @go_grid_api_key = options[:go_grid_api_key]
@go_grid_shared_secret = options[:go_grid_shared_secret] @go_grid_shared_secret = options[:go_grid_shared_secret]
@host = options[:host] || "api.gogrid.com" @connection_options = options[:connection_options] || {}
@path = options[:path] || "/api" @host = options[:host] || "api.gogrid.com"
@port = options[:port] || 443 @path = options[:path] || "/api"
@scheme = options[:scheme] || 'https' @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @port = options[:port] || 443
@scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -189,14 +189,13 @@ module Fog
@google_storage_access_key_id = options[:google_storage_access_key_id] @google_storage_access_key_id = options[:google_storage_access_key_id]
@google_storage_secret_access_key = options[:google_storage_secret_access_key] @google_storage_secret_access_key = options[:google_storage_secret_access_key]
@connection_options = options[:connection_options] || {}
@hmac = Fog::HMAC.new('sha1', @google_storage_secret_access_key) @hmac = Fog::HMAC.new('sha1', @google_storage_secret_access_key)
@host = options[:host] || 'commondatastorage.googleapis.com' @host = options[:host] || 'commondatastorage.googleapis.com'
@port = options[:port] || 443 @persistent = options[:persistent] || true
@scheme = options[:scheme] || 'https' @port = options[:port] || 443
unless options.has_key?(:persistent) @scheme = options[:scheme] || 'https'
options[:persistent] = true @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
end end
def reload def reload

View File

@ -54,11 +54,13 @@ module Fog
def initialize(options={}) def initialize(options={})
require 'multi_json' require 'multi_json'
@connection_options = options[:connection_options] || {}
@host = options[:host] || "api.linode.com"
@linode_api_key = options[:linode_api_key] @linode_api_key = options[:linode_api_key]
@host = options[:host] || "api.linode.com" @persistent = options[:persistent] || false
@port = options[:port] || 443 @port = options[:port] || 443
@scheme = options[:scheme] || 'https' @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -52,10 +52,12 @@ module Fog
@new_servers_password = options[:new_servers_password] @new_servers_password = options[:new_servers_password]
@new_servers_username = options[:new_servers_username] @new_servers_username = options[:new_servers_username]
@host = options[:host] || "noc.newservers.com" @connection_options = options[:connection_options] || {}
@port = options[:port] || 443 @host = options[:host] || "noc.newservers.com"
@scheme = options[:scheme] || 'https' @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @port = options[:port] || 443
@scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -68,7 +68,6 @@ module Fog
@api_url = options[:ninefold_api_url] || Fog.credentials[:ninefold_api_url] || API_URL @api_url = options[:ninefold_api_url] || Fog.credentials[:ninefold_api_url] || API_URL
@ninefold_compute_key = options[:ninefold_compute_key] || Fog.credentials[:ninefold_compute_key] @ninefold_compute_key = options[:ninefold_compute_key] || Fog.credentials[:ninefold_compute_key]
@ninefold_compute_secret = options[:ninefold_compute_secret] || Fog.credentials[:ninefold_compute_secret] @ninefold_compute_secret = options[:ninefold_compute_secret] || Fog.credentials[:ninefold_compute_secret]
@connection = Fog::Connection.new(@api_url)
end end
def request(options) def request(options)
@ -81,10 +80,12 @@ module Fog
def initialize(options) def initialize(options)
require 'multi_json' require 'multi_json'
@api_url = options[:ninefold_api_url] || Fog.credentials[:ninefold_api_url] || API_URL @api_url = options[:ninefold_api_url] || Fog.credentials[:ninefold_api_url] || API_URL
@ninefold_compute_key = options[:ninefold_compute_key] || Fog.credentials[:ninefold_compute_key] @ninefold_compute_key = options[:ninefold_compute_key] || Fog.credentials[:ninefold_compute_key]
@ninefold_compute_secret = options[:ninefold_compute_secret] || Fog.credentials[:ninefold_compute_secret] @ninefold_compute_secret = options[:ninefold_compute_secret] || Fog.credentials[:ninefold_compute_secret]
@connection = Fog::Connection.new(@api_url) @connection_options = options[:connection_options] || {}
@persistent = options[:persistent] || false
@connection = Fog::Connection.new(@api_url, @persistent, @connection_options)
end end
def request(command, params, options) def request(command, params, options)

View File

@ -51,10 +51,11 @@ module Fog
@ninefold_storage_secret = options[:ninefold_storage_secret] @ninefold_storage_secret = options[:ninefold_storage_secret]
@ninefold_storage_secret_decoded = Base64.decode64( @ninefold_storage_secret ) @ninefold_storage_secret_decoded = Base64.decode64( @ninefold_storage_secret )
@hmac = Fog::HMAC.new('sha1', @ninefold_storage_secret_decoded) @connection_options = options[:connection_options] || {}
@hmac = Fog::HMAC.new('sha1', @ninefold_storage_secret_decoded)
@persistent = options[:persistent] || true
Excon.ssl_verify_peer = false if options[:rackspace_servicenet] == true @connection = Fog::Connection.new("#{Fog::Storage::Ninefold::STORAGE_SCHEME}://#{Fog::Storage::Ninefold::STORAGE_HOST}:#{Fog::Storage::Ninefold::STORAGE_PORT}", @persistent, @connection_options)
@connection = Fog::Connection.new("#{Fog::Storage::Ninefold::STORAGE_SCHEME}://#{Fog::Storage::Ninefold::STORAGE_HOST}:#{Fog::Storage::Ninefold::STORAGE_PORT}", true) # persistent
end end
def uid def uid

View File

@ -48,12 +48,12 @@ module Fog
service(:storage, 'rackspace/storage') service(:storage, 'rackspace/storage')
service(:load_balancers, 'rackspace/load_balancers') service(:load_balancers, 'rackspace/load_balancers')
def self.authenticate(options) def self.authenticate(options, connection_options = {})
rackspace_auth_url = options[:rackspace_auth_url] || "auth.api.rackspacecloud.com" rackspace_auth_url = options[:rackspace_auth_url] || "auth.api.rackspacecloud.com"
url = rackspace_auth_url.match(/^https?:/) ? \ url = rackspace_auth_url.match(/^https?:/) ? \
rackspace_auth_url : 'https://' + rackspace_auth_url rackspace_auth_url : 'https://' + rackspace_auth_url
uri = URI.parse(url) uri = URI.parse(url)
connection = Fog::Connection.new(url) connection = Fog::Connection.new(url, false, connection_options)
@rackspace_api_key = options[:rackspace_api_key] @rackspace_api_key = options[:rackspace_api_key]
@rackspace_username = options[:rackspace_username] @rackspace_username = options[:rackspace_username]
response = connection.request({ response = connection.request({

View File

@ -46,9 +46,11 @@ module Fog
def initialize(options={}) def initialize(options={})
require 'multi_json' require 'multi_json'
credentials = Fog::Rackspace.authenticate(options) @connection_options = options[:connection_options] || {}
credentials = Fog::Rackspace.authenticate(options, @connection_options)
@auth_token = credentials['X-Auth-Token'] @auth_token = credentials['X-Auth-Token']
@enabled = false @enabled = false
@persistent = options[:persistent] || false
if credentials['X-CDN-Management-Url'] if credentials['X-CDN-Management-Url']
uri = URI.parse(credentials['X-CDN-Management-Url']) uri = URI.parse(credentials['X-CDN-Management-Url'])
@ -56,7 +58,7 @@ module Fog
@path = uri.path @path = uri.path
@port = uri.port @port = uri.port
@scheme = uri.scheme @scheme = uri.scheme
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
@enabled = true @enabled = true
end end
end end

View File

@ -86,9 +86,11 @@ module Fog
@rackspace_auth_token = options[:rackspace_auth_token] @rackspace_auth_token = options[:rackspace_auth_token]
@rackspace_management_url = options[:rackspace_management_url] @rackspace_management_url = options[:rackspace_management_url]
@rackspace_must_reauthenticate = false @rackspace_must_reauthenticate = false
@connection_options = options[:connection_options] || {}
authenticate authenticate
Excon.ssl_verify_peer = false if options[:rackspace_servicenet] == true Excon.ssl_verify_peer = false if options[:rackspace_servicenet] == true
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload
@ -137,7 +139,7 @@ module Fog
:rackspace_username => @rackspace_username, :rackspace_username => @rackspace_username,
:rackspace_auth_url => @rackspace_auth_url :rackspace_auth_url => @rackspace_auth_url
} }
credentials = Fog::Rackspace.authenticate(options) credentials = Fog::Rackspace.authenticate(options, @connection_options)
@auth_token = credentials['X-Auth-Token'] @auth_token = credentials['X-Auth-Token']
uri = URI.parse(credentials['X-Server-Management-Url']) uri = URI.parse(credentials['X-Server-Management-Url'])
else else

View File

@ -44,13 +44,17 @@ module Fog
@rackspace_api_key = options[:rackspace_api_key] @rackspace_api_key = options[:rackspace_api_key]
@rackspace_username = options[:rackspace_username] @rackspace_username = options[:rackspace_username]
@rackspace_auth_url = options[:rackspace_auth_url] @rackspace_auth_url = options[:rackspace_auth_url]
@connection_options = options[:connection_options] || {}
uri = URI.parse(options[:rackspace_dns_endpoint] || US_ENDPOINT) uri = URI.parse(options[:rackspace_dns_endpoint] || US_ENDPOINT)
@auth_token, @account_id = *authenticate @auth_token, @account_id = *authenticate
@path = "#{uri.path}/#{@account_id}" @persistent = options[:persistent] || false
headers = { 'Content-Type' => 'application/json', 'X-Auth-Token' => @auth_token } @path = "#{uri.path}/#{@account_id}"
@connection = Fog::Connection.new(uri.to_s, options[:persistent], { :headers => headers}) @connection_options[:headers] ||= {}
@connection_options[:headers].merge!({ 'Content-Type' => 'application/json', 'X-Auth-Token' => @auth_token })
@connection = Fog::Connection.new(uri.to_s, @persistent, @connection_options)
end end
private private
@ -82,7 +86,7 @@ module Fog
:rackspace_username => @rackspace_username, :rackspace_username => @rackspace_username,
:rackspace_auth_url => @rackspace_auth_url :rackspace_auth_url => @rackspace_auth_url
} }
credentials = Fog::Rackspace.authenticate(options) credentials = Fog::Rackspace.authenticate(options, @connection_options)
auth_token = credentials['X-Auth-Token'] auth_token = credentials['X-Auth-Token']
account_id = credentials['X-Server-Management-Url'].match(/.*\/([\d]+)$/)[1] account_id = credentials['X-Server-Management-Url'].match(/.*\/([\d]+)$/)[1]
[auth_token, account_id] [auth_token, account_id]

View File

@ -98,15 +98,17 @@ module Fog
@rackspace_username = options[:rackspace_username] @rackspace_username = options[:rackspace_username]
@rackspace_auth_url = options[:rackspace_auth_url] @rackspace_auth_url = options[:rackspace_auth_url]
@rackspace_must_reauthenticate = false @rackspace_must_reauthenticate = false
@connection_options = options[:connection_options] || {}
uri = URI.parse(options[:rackspace_lb_endpoint] || DFW_ENDPOINT) uri = URI.parse(options[:rackspace_lb_endpoint] || DFW_ENDPOINT)
@host = uri.host @host = uri.host
@path = uri.path @persistent = options[:persistent] || false
@port = uri.port @path = uri.path
@scheme = uri.scheme @port = uri.port
@scheme = uri.scheme
authenticate authenticate
@connection = Fog::Connection.new(uri.to_s, options[:persistent]) @connection = Fog::Connection.new(uri.to_s, @persistent, @connection_options)
end end
def request(params) def request(params)
@ -141,7 +143,7 @@ module Fog
:rackspace_username => @rackspace_username, :rackspace_username => @rackspace_username,
:rackspace_auth_url => @rackspace_auth_url :rackspace_auth_url => @rackspace_auth_url
} }
credentials = Fog::Rackspace.authenticate(options) credentials = Fog::Rackspace.authenticate(options, @connection_options)
@auth_token = credentials['X-Auth-Token'] @auth_token = credentials['X-Auth-Token']
account_id = credentials['X-Server-Management-Url'].match(/.*\/([\d]+)$/)[1] account_id = credentials['X-Server-Management-Url'].match(/.*\/([\d]+)$/)[1]
@path = "#{@path}/#{account_id}" @path = "#{@path}/#{account_id}"

View File

@ -83,16 +83,18 @@ module Fog
@rackspace_username = options[:rackspace_username] @rackspace_username = options[:rackspace_username]
@rackspace_cdn_ssl = options[:rackspace_cdn_ssl] @rackspace_cdn_ssl = options[:rackspace_cdn_ssl]
@rackspace_auth_url = options[:rackspace_auth_url] @rackspace_auth_url = options[:rackspace_auth_url]
credentials = Fog::Rackspace.authenticate(options) @connection_options = options[:connection_options] || {}
credentials = Fog::Rackspace.authenticate(options, @connection_options)
@auth_token = credentials['X-Auth-Token'] @auth_token = credentials['X-Auth-Token']
uri = URI.parse(credentials['X-Storage-Url']) uri = URI.parse(credentials['X-Storage-Url'])
@host = options[:rackspace_servicenet] == true ? "snet-#{uri.host}" : uri.host @host = options[:rackspace_servicenet] == true ? "snet-#{uri.host}" : uri.host
@path = uri.path @path = uri.path
@port = uri.port @persistent = options[:persistent] || false
@scheme = uri.scheme @port = uri.port
@scheme = uri.scheme
Excon.ssl_verify_peer = false if options[:rackspace_servicenet] == true Excon.ssl_verify_peer = false if options[:rackspace_servicenet] == true
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -60,10 +60,12 @@ module Fog
require 'fog/core/parser' require 'fog/core/parser'
@slicehost_password = options[:slicehost_password] @slicehost_password = options[:slicehost_password]
@host = options[:host] || "api.slicehost.com" @connection_options = options[:connection_options] || {}
@port = options[:port] || 443 @host = options[:host] || "api.slicehost.com"
@scheme = options[:scheme] || 'https' @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @port = options[:port] || 443
@scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -56,10 +56,12 @@ module Fog
require 'fog/core/parser' require 'fog/core/parser'
@slicehost_password = options[:slicehost_password] @slicehost_password = options[:slicehost_password]
@host = options[:host] || "api.slicehost.com" @connection_options = options[:connection_options] || {}
@port = options[:port] || 443 @host = options[:host] || "api.slicehost.com"
@scheme = options[:scheme] || 'https' @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @port = options[:port] || 443
@scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -87,13 +87,15 @@ module Fog
def initialize(options={}) def initialize(options={})
require 'multi_json' require 'multi_json'
uri = URI.parse(options[:storm_on_demand_auth_url] ||= API_URL) uri = URI.parse(options[:storm_on_demand_auth_url] ||= API_URL)
@host = uri.host @connection_options = options[:connection_options] || {}
@path = uri.path @host = uri.host
@port = uri.port @path = uri.path
@scheme = uri.scheme @persistent = options[:persistent] || false
@port = uri.port
@scheme = uri.scheme
@storm_on_demand_username = options[:storm_on_demand_username] @storm_on_demand_username = options[:storm_on_demand_username]
@storm_on_demand_password = options[:storm_on_demand_password] @storm_on_demand_password = options[:storm_on_demand_password]
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}") @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View File

@ -39,11 +39,13 @@ module Fog
def initialize(options={}) def initialize(options={})
@terremark_password = options[:terremark_vcloud_password] @terremark_password = options[:terremark_vcloud_password]
@terremark_username = options[:terremark_vcloud_username] @terremark_username = options[:terremark_vcloud_username]
@host = options[:host] || Fog::Terremark::Vcloud::Defaults::HOST @connection_options = options[:connection_options] || {}
@path = options[:path] || Fog::Terremark::Vcloud::Defaults::PATH @host = options[:host] || Fog::Terremark::Vcloud::Defaults::HOST
@port = options[:port] || Fog::Terremark::Vcloud::Defaults::PORT @path = options[:path] || Fog::Terremark::Vcloud::Defaults::PATH
@scheme = options[:scheme] || Fog::Terremark::Vcloud::Defaults::SCHEME @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @port = options[:port] || Fog::Terremark::Vcloud::Defaults::PORT
@scheme = options[:scheme] || Fog::Terremark::Vcloud::Defaults::SCHEME
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def default_vdc_id def default_vdc_id

View File

@ -162,6 +162,7 @@ module Fog
require 'fog/core/parser' require 'fog/core/parser'
@connections = {} @connections = {}
@connection_options = options[:connection_options] || {}
@persistent = options[:persistent] @persistent = options[:persistent]
@username = options[:vcloud_username] @username = options[:vcloud_username]
@ -268,7 +269,7 @@ module Fog
# Hash connections on the host_url ... There's nothing to say we won't get URI's that go to # Hash connections on the host_url ... There's nothing to say we won't get URI's that go to
# different hosts. # different hosts.
@connections[host_url] ||= Fog::Connection.new(host_url, @persistent) @connections[host_url] ||= Fog::Connection.new(host_url, @persistent, @connection_options)
# Set headers to an empty hash if none are set. # Set headers to an empty hash if none are set.
headers = params[:headers] || {} headers = params[:headers] || {}

View File

@ -79,14 +79,15 @@ module Fog
@voxel_api_key = options[:voxel_api_key] @voxel_api_key = options[:voxel_api_key]
@voxel_api_secret = options[:voxel_api_secret] @voxel_api_secret = options[:voxel_api_secret]
@host = options[:host] || "api.voxel.net" @connection_options = options[:connection_options] || {}
@port = options[:port] || 443 @host = options[:host] || "api.voxel.net"
@scheme = options[:scheme] || 'https' @port = options[:port] || 443
@persistent = options[:persistent] || false @scheme = options[:scheme] || 'https'
@persistent = options[:persistent] || false
Excon.ssl_verify_peer = false Excon.ssl_verify_peer = false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent) @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def request(method_name, options = {}) def request(method_name, options = {})

View File

@ -64,10 +64,12 @@ module Fog
@zerigo_email = options[:zerigo_email] @zerigo_email = options[:zerigo_email]
@zerigo_token = options[:zerigo_token] @zerigo_token = options[:zerigo_token]
@host = options[:host] || "ns.zerigo.com" @connection_options = options[:connection_options] || {}
@port = options[:port] || 80 @host = options[:host] || "ns.zerigo.com"
@scheme = options[:scheme] || 'http' @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @port = options[:port] || 80
@scheme = options[:scheme] || 'http'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload