1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[GH-2711] Replace Fog::Connection with XML shim

Unlike last attempt this replaces Fog::Connection with
Fog::XML::Connection which should be directly compatible.

Fog::Connection is there for old PRs but should be removed real soon.

Providers using JSON should be able to replace "XML" with "Core" within
their code to cut down on the dependency.

If I get the time I may attempt to clean up some but testing with Mock
will mean that is mostly educated guesswork.
This commit is contained in:
Paul Thornthwaite 2014-02-27 00:50:35 +00:00
parent 1768f2a37e
commit 0e1daf3ddd
90 changed files with 100 additions and 100 deletions

View file

@ -83,7 +83,7 @@ module Fog
@hmac = Fog::HMAC.new('sha1', @storage_secret_decoded) @hmac = Fog::HMAC.new('sha1', @storage_secret_decoded)
@persistent = options.fetch(:persistent, false) @persistent = options.fetch(:persistent, false)
@connection = Fog::Connection.new("#{@prefix}://#{@storage_host}:#{@storage_port}", @connection = Fog::XML::Connection.new("#{@prefix}://#{@storage_host}:#{@storage_port}",
@persistent, @connection_options) @persistent, @connection_options)
end end

View file

@ -104,7 +104,7 @@ module Fog
@port = options[:port] || 443 @port = options[:port] || 443
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@scheme = options[:scheme] || 'https' @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -78,7 +78,7 @@ module Fog
@persistent = options[:persistent] || false @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}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -154,7 +154,7 @@ EOF
@port = options[:port] || 443 @port = options[:port] || 443
@scheme = options[:scheme] || 'https' @scheme = options[:scheme] || 'https'
@version = options[:version] || '2010-11-01' @version = options[:version] || '2010-11-01'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -60,7 +60,7 @@ module Fog
@persistent = options[:persistent] || false @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}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -104,7 +104,7 @@ module Fog
@persistent = options[:persistent] || false @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}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -399,7 +399,7 @@ module Fog
@port = options[:port] || 443 @port = options[:port] || 443
@scheme = options[:scheme] || 'https' @scheme = options[:scheme] || 'https'
end end
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -62,7 +62,7 @@ module Fog
@persistent = options[:persistent] || false @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}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
setup_credentials(options) setup_credentials(options)
end end

View file

@ -99,7 +99,7 @@ module Fog
@scheme = options[:scheme] || 'https' @scheme = options[:scheme] || 'https'
@version = options[:version] || '2012-02-29' @version = options[:version] || '2012-02-29'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -88,7 +88,7 @@ module Fog
@port = options[:port] || '443' @port = options[:port] || '443'
@scheme = options[:scheme] || 'https' @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
private private

View file

@ -62,7 +62,7 @@ module Fog
@path = options[:path] || '/' @path = options[:path] || '/'
@port = options[:port] || 443 @port = options[:port] || 443
@scheme = options[:scheme] || 'https' @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new( @connection = Fog::XML::Connection.new(
"#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent] "#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]
) )
end end

View file

@ -139,7 +139,7 @@ module Fog
@persistent = options[:persistent] || false @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}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -73,7 +73,7 @@ module Fog
@persistent = options[:persistent] || false @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}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
@region = options[:region] @region = options[:region]
end end

View file

@ -134,7 +134,7 @@ module Fog
@port = options[:port] || 443 @port = options[:port] || 443
@scheme = options[:scheme] || 'https' @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end

View file

@ -170,7 +170,7 @@ module Fog
@persistent = options[:persistent] || false @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}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -168,7 +168,7 @@ module Fog
@persistent = options[:persistent] || false @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}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
@version = options[:version] || '2013-05-15' @version = options[:version] || '2013-05-15'
end end

View file

@ -90,7 +90,7 @@ module Fog
@port = options[:port] || 443 @port = options[:port] || 443
@scheme = options[:scheme] || 'https' @scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end

View file

@ -62,7 +62,7 @@ module Fog
@persistent = options[:persistent] || false @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}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -89,7 +89,7 @@ module Fog
@persistent = options[:persistent] || false @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}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
private private

View file

@ -61,7 +61,7 @@ module Fog
@persistent = options[:persistent] || false @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}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -89,7 +89,7 @@ module Fog
@persistent = options[:persistent] || false @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}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -523,7 +523,7 @@ DATA
else else
@connection = nil @connection = nil
end end
@connection ||= Fog::Connection.new(uri, @persistent, @connection_options) @connection ||= Fog::XML::Connection.new(uri, @persistent, @connection_options)
end end
def request(params, &block) def request(params, &block)
@ -550,7 +550,7 @@ DATA
headers = (error.response.is_a?(Hash) ? error.response[:headers] : error.response.headers) headers = (error.response.is_a?(Hash) ? error.response[:headers] : error.response.headers)
uri = URI.parse(headers['Location']) uri = URI.parse(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("#{uri.scheme}://#{uri.host}:#{uri.port}", false, @connection_options).request(original_params, &block) response = Fog::XML::Connection.new("#{uri.scheme}://#{uri.host}:#{uri.port}", false, @connection_options).request(original_params, &block)
end end
response response

View file

@ -83,7 +83,7 @@ module Fog
@persistent = options[:persistent] || false @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}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -58,7 +58,7 @@ module Fog
@persistent = options[:persistent] || false @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}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -50,7 +50,7 @@ module Fog
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@port = options[:bluebox_port] || 443 @port = options[:bluebox_port] || 443
@scheme = options[:bluebox_scheme] || 'https' @scheme = options[:bluebox_scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -68,7 +68,7 @@ module Fog
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@port = options[:bluebox_port] || 443 @port = options[:bluebox_port] || 443
@scheme = options[:bluebox_scheme] || 'https' @scheme = options[:bluebox_scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -59,7 +59,7 @@ module Fog
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@port = options[:bluebox_port] || 443 @port = options[:bluebox_port] || 443
@scheme = options[:bluebox_scheme] || 'https' @scheme = options[:bluebox_scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -84,7 +84,7 @@ module Fog
@clodo_must_reauthenticate = false @clodo_must_reauthenticate = false
authenticate authenticate
Excon.ssl_verify_peer = false if options[:clodo_servicenet] == true Excon.ssl_verify_peer = false if options[:clodo_servicenet] == true
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
end end
def reload def reload

View file

@ -13,7 +13,7 @@ module Fog
url = clodo_auth_url.match(/^https?:/) ? \ url = clodo_auth_url.match(/^https?:/) ? \
clodo_auth_url : 'https://' + clodo_auth_url clodo_auth_url : 'https://' + clodo_auth_url
uri = URI.parse(url) uri = URI.parse(url)
connection = Fog::Connection.new(url) connection = Fog::XML::Connection.new(url)
@clodo_api_key = options[:clodo_api_key] @clodo_api_key = options[:clodo_api_key]
@clodo_username = options[:clodo_username] @clodo_username = options[:clodo_username]
response = connection.request({ response = connection.request({

View file

@ -37,7 +37,7 @@ module Fog
@api_version = options[:cloudsigma_api_version] || '2.0' @api_version = options[:cloudsigma_api_version] || '2.0'
@path_prefix = "#{@api_path_prefix}/#{@api_version}/" @path_prefix = "#{@api_path_prefix}/#{@api_version}/"
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def request(params) def request(params)

View file

@ -149,7 +149,7 @@ module Fog
@path = options[:cloudstack_path] || '/client/api' @path = options[:cloudstack_path] || '/client/api'
@port = options[:cloudstack_port] || 443 @port = options[:cloudstack_port] || 443
@scheme = options[:cloudstack_scheme] || 'https' @scheme = options[:cloudstack_scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:cloudstack_persistent], {:ssl_verify_peer => false}) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:cloudstack_persistent], {:ssl_verify_peer => false})
end end
def reload def reload

View file

@ -15,9 +15,9 @@ module Fog
class Connection < Fog::XML::Connection class Connection < Fog::XML::Connection
def request(params, &block) def request(params, &block)
if params.key?(:parser) if params.key?(:parser)
Fog::Logger.deprecation("Fog::Connection is deprecated use Fog::XML::Connection instead [light_black](#{caller.first})[/]") Fog::Logger.deprecation("Fog::XML::Connection is deprecated use Fog::XML::Connection instead [light_black](#{caller.first})[/]")
else else
Fog::Logger.deprecation("Fog::Connection is deprecated use Fog::Core::Connection instead [light_black](#{caller.first})[/]") Fog::Logger.deprecation("Fog::XML::Connection is deprecated use Fog::Core::Connection instead [light_black](#{caller.first})[/]")
end end
super(params) super(params)
end end

View file

@ -77,7 +77,7 @@ module Fog
@digitalocean_client_id = options[:digitalocean_client_id] @digitalocean_client_id = options[:digitalocean_client_id]
@digitalocean_api_url = options[:digitalocean_api_url] || \ @digitalocean_api_url = options[:digitalocean_api_url] || \
"https://api.digitalocean.com" "https://api.digitalocean.com"
@connection = Fog::Connection.new(@digitalocean_api_url) @connection = Fog::XML::Connection.new(@digitalocean_api_url)
end end
def reload def reload

View file

@ -70,7 +70,7 @@ module Fog
@persistent = options[:persistent] || false @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}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -87,7 +87,7 @@ module Fog
@persistent = options.fetch(:persistent, true) @persistent = options.fetch(:persistent, true)
@port = options[:port] || 80 #443 Not yet @port = options[:port] || 80 #443 Not yet
@scheme = options[:scheme] || 'http' #'https Not yet @scheme = options[:scheme] || 'http' #'https Not yet
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -57,7 +57,7 @@ module Fog
@persistent = options[:persistent] || false @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}", @persistent) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent)
end end
def reload def reload

View file

@ -72,7 +72,7 @@ module Fog
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@scheme = options[:scheme] || 'https' @scheme = options[:scheme] || 'https'
@version = options[:version] || '3.5.2' @version = options[:version] || '3.5.2'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def auth_token def auth_token

View file

@ -317,7 +317,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, @connection_options) @connections[host_url] ||= Fog::XML::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 = set_extra_headers_for(params) || set_extra_headers_for({}) headers = set_extra_headers_for(params) || set_extra_headers_for({})

View file

@ -79,7 +79,7 @@ module Fog
@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_options = options[:connection_options] || {} @connection_options = options[:connection_options] || {}
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new(@api_url, @persistent, @connection_options) @connection = Fog::XML::Connection.new(@api_url, @persistent, @connection_options)
end end
def request(method_name, options = {}) def request(method_name, options = {})

View file

@ -68,7 +68,7 @@ module Fog
@persistent = options[:persistent] || false @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}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -283,7 +283,7 @@ DATA
else else
@connection = nil @connection = nil
end end
@connection ||= Fog::Connection.new(uri, @persistent, @connection_options) @connection ||= Fog::XML::Connection.new(uri, @persistent, @connection_options)
end end
private private

View file

@ -138,7 +138,7 @@ module Fog
@port = uri.port @port = uri.port
@scheme = uri.scheme @scheme = uri.scheme
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -127,7 +127,7 @@ module Fog
@port = uri.port @port = uri.port
@scheme = uri.scheme @scheme = uri.scheme
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -115,7 +115,7 @@ module Fog
@path = uri.path.chomp("/") @path = uri.path.chomp("/")
@port = uri.port @port = uri.port
@scheme = uri.scheme @scheme = uri.scheme
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
@enabled = true @enabled = true
end end
end end

View file

@ -220,7 +220,7 @@ module Fog
@port = uri.port @port = uri.port
@scheme = uri.scheme @scheme = uri.scheme
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -274,7 +274,7 @@ module Fog
@port = uri.port @port = uri.port
@scheme = uri.scheme @scheme = uri.scheme
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -82,7 +82,7 @@ module Fog
# Set the User-Agent # Set the User-Agent
@user_agent = options[:user_agent] @user_agent = options[:user_agent]
set_user_agent_header(connection_options, "fog/#{Fog::VERSION}", @user_agent) set_user_agent_header(connection_options, "fog/#{Fog::VERSION}", @user_agent)
connection = Fog::Connection.new(service_url, false, connection_options) connection = Fog::XML::Connection.new(service_url, false, connection_options)
@hp_access_key = options[:hp_access_key] @hp_access_key = options[:hp_access_key]
@hp_secret_key = options[:hp_secret_key] @hp_secret_key = options[:hp_secret_key]
response = connection.request({ response = connection.request({
@ -158,7 +158,7 @@ module Fog
# Set the User-Agent. If the caller sets a user_agent, use it. # Set the User-Agent. If the caller sets a user_agent, use it.
@user_agent = options[:user_agent] @user_agent = options[:user_agent]
set_user_agent_header(connection_options, "fog/#{Fog::VERSION}", @user_agent) set_user_agent_header(connection_options, "fog/#{Fog::VERSION}", @user_agent)
connection = Fog::Connection.new(service_url, false, connection_options) connection = Fog::XML::Connection.new(service_url, false, connection_options)
### Implement HP Control Services Authentication services ### ### Implement HP Control Services Authentication services ###
# Get the style of auth credentials passed, defaults to access/secret key style # Get the style of auth credentials passed, defaults to access/secret key style

View file

@ -97,7 +97,7 @@ module Fog
@port = uri.port @port = uri.port
@scheme = uri.scheme @scheme = uri.scheme
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -132,7 +132,7 @@ module Fog
@port = uri.port @port = uri.port
@scheme = uri.scheme @scheme = uri.scheme
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -155,7 +155,7 @@ module Fog
@port = uri.port @port = uri.port
@scheme = uri.scheme @scheme = uri.scheme
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -351,7 +351,7 @@ module Fog
@port = uri.port @port = uri.port
@scheme = uri.scheme @scheme = uri.scheme
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -16,7 +16,7 @@ module Fog
1800 1800
end end
class Connection < Fog::Connection class Connection < Fog::XML::Connection
def initialize(user, password) def initialize(user, password)
@user = user @user = user

View file

@ -269,7 +269,7 @@ module Fog
@port = options[:port] || 80 @port = options[:port] || 80
@scheme = options[:scheme] || 'http' @scheme = options[:scheme] || 'http'
end end
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end end
def reload def reload
@ -376,7 +376,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, @connection_options).request(original_params, &block) response = Fog::XML::Connection.new("#{@scheme}://#{uri.host}:#{@port}", false, @connection_options).request(original_params, &block)
end end
response response

View file

@ -188,7 +188,7 @@ module Fog
raise ArgumentError, "Must provide either a joyent_password or joyent_keyname and joyent_keyfile pair" raise ArgumentError, "Must provide either a joyent_password or joyent_keyname and joyent_keyfile pair"
end end
@connection = Fog::Connection.new( @connection = Fog::XML::Connection.new(
@joyent_url, @joyent_url,
@persistent, @persistent,
@connection_options @connection_options

View file

@ -158,7 +158,7 @@ module Fog
raise ArgumentError, "Must provide either a joyent_password or joyent_keyname and joyent_keyfile pair" raise ArgumentError, "Must provide either a joyent_password or joyent_keyname and joyent_keyfile pair"
end end
@connection = Fog::Connection.new( @connection = Fog::XML::Connection.new(
@joyent_url, @joyent_url,
@persistent, @persistent,
@connection_options @connection_options

View file

@ -83,7 +83,7 @@ module Fog
@host = options[:host] || "api.linode.com" @host = options[:host] || "api.linode.com"
@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::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
end end
def reload def reload

View file

@ -58,7 +58,7 @@ module Fog
@persistent = options[:persistent] || false @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}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -89,7 +89,7 @@ module Fog
@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_options = options[:connection_options] || {} @connection_options = options[:connection_options] || {}
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new(@api_url, @persistent, @connection_options) @connection = Fog::XML::Connection.new(@api_url, @persistent, @connection_options)
end end
def request(command, params, options) def request(command, params, options)

View file

@ -320,7 +320,7 @@ module Fog
authenticate authenticate
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def credentials def credentials
@ -422,7 +422,7 @@ module Fog
# Not all implementations have identity service in the catalog # Not all implementations have identity service in the catalog
if @openstack_identity_public_endpoint || @openstack_management_url if @openstack_identity_public_endpoint || @openstack_management_url
@identity_connection = Fog::Connection.new( @identity_connection = Fog::XML::Connection.new(
@openstack_identity_public_endpoint || @openstack_management_url, @openstack_identity_public_endpoint || @openstack_management_url,
false, @connection_options) false, @connection_options)
end end

View file

@ -63,7 +63,7 @@ module Fog
# legacy v1.0 style auth # legacy v1.0 style auth
def self.authenticate_v1(options, connection_options = {}) def self.authenticate_v1(options, connection_options = {})
uri = options[:openstack_auth_uri] uri = options[:openstack_auth_uri]
connection = Fog::Connection.new(uri.to_s, false, connection_options) connection = Fog::XML::Connection.new(uri.to_s, false, connection_options)
@openstack_api_key = options[:openstack_api_key] @openstack_api_key = options[:openstack_api_key]
@openstack_username = options[:openstack_username] @openstack_username = options[:openstack_username]
@ -102,7 +102,7 @@ module Fog
unless service unless service
unless tenant_name unless tenant_name
response = Fog::Connection.new( response = Fog::XML::Connection.new(
"#{uri.scheme}://#{uri.host}:#{uri.port}/v2.0/tenants", false, connection_options).request({ "#{uri.scheme}://#{uri.host}:#{uri.port}/v2.0/tenants", false, connection_options).request({
:expects => [200, 204], :expects => [200, 204],
:headers => {'Content-Type' => 'application/json', :headers => {'Content-Type' => 'application/json',
@ -186,7 +186,7 @@ module Fog
auth_token = options[:openstack_auth_token] || options[:unscoped_token] auth_token = options[:openstack_auth_token] || options[:unscoped_token]
uri = options[:openstack_auth_uri] uri = options[:openstack_auth_uri]
connection = Fog::Connection.new(uri.to_s, false, connection_options) connection = Fog::XML::Connection.new(uri.to_s, false, connection_options)
request_body = {:auth => Hash.new} request_body = {:auth => Hash.new}
if auth_token if auth_token
@ -213,7 +213,7 @@ module Fog
end end
def self.get_supported_version(supported_versions, uri, auth_token, connection_options = {}) def self.get_supported_version(supported_versions, uri, auth_token, connection_options = {})
connection = Fog::Connection.new("#{uri.scheme}://#{uri.host}:#{uri.port}", false, connection_options) connection = Fog::XML::Connection.new("#{uri.scheme}://#{uri.host}:#{uri.port}", false, connection_options)
response = connection.request({ response = connection.request({
:expects => [200, 204, 300], :expects => [200, 204, 300],
:headers => {'Content-Type' => 'application/json', :headers => {'Content-Type' => 'application/json',

View file

@ -200,7 +200,7 @@ module Fog
authenticate authenticate
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def credentials def credentials

View file

@ -122,7 +122,7 @@ module Fog
authenticate authenticate
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def credentials def credentials

View file

@ -116,7 +116,7 @@ module Fog
authenticate authenticate
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def credentials def credentials

View file

@ -256,7 +256,7 @@ module Fog
authenticate authenticate
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def credentials def credentials

View file

@ -114,7 +114,7 @@ module Fog
authenticate authenticate
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def credentials def credentials
@ -214,7 +214,7 @@ module Fog
# Not all implementations have identity service in the catalog # Not all implementations have identity service in the catalog
if @openstack_identity_public_endpoint || @openstack_management_url if @openstack_identity_public_endpoint || @openstack_management_url
@identity_connection = Fog::Connection.new( @identity_connection = Fog::XML::Connection.new(
@openstack_identity_public_endpoint || @openstack_management_url, @openstack_identity_public_endpoint || @openstack_management_url,
false, @connection_options) false, @connection_options)
end end

View file

@ -92,7 +92,7 @@ module Fog
@openstack_temp_url_key = options[:openstack_temp_url_key] @openstack_temp_url_key = options[:openstack_temp_url_key]
authenticate authenticate
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -136,7 +136,7 @@ module Fog
authenticate authenticate
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def credentials def credentials

View file

@ -96,7 +96,7 @@ module Fog
authenticate authenticate
@connection = Fog::Connection.new(endpoint_uri.to_s, @options[:persistent], @options[:connection_options]) @connection = Fog::XML::Connection.new(endpoint_uri.to_s, @options[:persistent], @options[:connection_options])
end end
def request(params, parse_json = true, &block) def request(params, parse_json = true, &block)

View file

@ -82,7 +82,7 @@ module Fog
deprecation_warnings(options) deprecation_warnings(options)
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options) @connection = Fog::XML::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
end end
def request(params, parse_json = true) def request(params, parse_json = true)

View file

@ -143,7 +143,7 @@ module Fog
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
if endpoint_uri if endpoint_uri
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options) @connection = Fog::XML::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
@enabled = true @enabled = true
end end
end end

View file

@ -197,7 +197,7 @@ module Fog
authenticate authenticate
Excon.defaults[:ssl_verify_peer] = false if service_net? Excon.defaults[:ssl_verify_peer] = false if service_net?
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options) @connection = Fog::XML::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
end end
def reload def reload

View file

@ -145,7 +145,7 @@ module Fog
deprecation_warnings(options) deprecation_warnings(options)
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options) @connection = Fog::XML::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
end end
def request(params, parse_json = true) def request(params, parse_json = true)

View file

@ -104,7 +104,7 @@ module Fog
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, false, connection_options) connection = Fog::XML::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

@ -82,7 +82,7 @@ module Fog
deprecation_warnings(options) deprecation_warnings(options)
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options) @connection = Fog::XML::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
end end
def request(params, parse_json = true) def request(params, parse_json = true)

View file

@ -101,7 +101,7 @@ module Fog
deprecation_warnings(options) deprecation_warnings(options)
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options) @connection = Fog::XML::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
end end
def endpoint_uri(service_endpoint_url=nil) def endpoint_uri(service_endpoint_url=nil)

View file

@ -74,7 +74,7 @@ module Fog
def initialize(options={}) def initialize(options={})
apply_options(options) apply_options(options)
@connection = Fog::Connection.new(@uri.to_s, @persistent, @connection_options) @connection = Fog::XML::Connection.new(@uri.to_s, @persistent, @connection_options)
authenticate authenticate
end end

View file

@ -119,7 +119,7 @@ module Fog
deprecation_warnings(options) deprecation_warnings(options)
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options) @connection = Fog::XML::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
end end
def request(params, parse_json = true) def request(params, parse_json = true)

View file

@ -140,7 +140,7 @@ module Fog
authenticate authenticate
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options) @connection = Fog::XML::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
end end
def reload def reload

View file

@ -378,7 +378,7 @@ module Fog
authenticate authenticate
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options) @connection = Fog::XML::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
end end
def request(params, parse_json = true, &block) def request(params, parse_json = true, &block)

View file

@ -419,7 +419,7 @@ module Fog
authenticate authenticate
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
Excon.defaults[:ssl_verify_peer] = false if service_net? Excon.defaults[:ssl_verify_peer] = false if service_net?
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options) @connection = Fog::XML::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
end end
# Using SSL? # Using SSL?

View file

@ -48,7 +48,7 @@ module Fog
@persistent = options[:persistent] || false @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}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -53,7 +53,7 @@ module Fog
@connection_options = options[:connection_options] || {} @connection_options = options[:connection_options] || {}
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@raw_connection = Fog::Connection.new(riakcs_uri, @persistent, @connection_options) @raw_connection = Fog::XML::Connection.new(riakcs_uri, @persistent, @connection_options)
@s3_connection = Fog::Storage.new( @s3_connection = Fog::Storage.new(
:provider => 'AWS', :provider => 'AWS',

View file

@ -59,7 +59,7 @@ module Fog
@api_key = options[:serverlove_api_key] || Fog.credentials[:serverlove_api_key] @api_key = options[:serverlove_api_key] || Fog.credentials[:serverlove_api_key]
@api_host = options[:serverlove_api_url] || Fog.credentials[:serverlove_api_url] || API_HOST @api_host = options[:serverlove_api_url] || Fog.credentials[:serverlove_api_url] || API_HOST
@connection = Fog::Connection.new("https://#{@api_uuid}:#{@api_key}@#{@api_host}") @connection = Fog::XML::Connection.new("https://#{@api_uuid}:#{@api_key}@#{@api_host}")
end end
def request(params) def request(params)

View file

@ -15,7 +15,7 @@ module Fog
@scheme = uri.scheme @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}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload

View file

@ -46,7 +46,7 @@ module Fog
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@port = options[:port] || Fog::Terremark::Vcloud::Defaults::PORT @port = options[:port] || Fog::Terremark::Vcloud::Defaults::PORT
@scheme = options[:scheme] || Fog::Terremark::Vcloud::Defaults::SCHEME @scheme = options[:scheme] || Fog::Terremark::Vcloud::Defaults::SCHEME
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def default_vdc_id def default_vdc_id

View file

@ -319,7 +319,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, @connection_options) @connections[host_url] ||= Fog::XML::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

@ -335,7 +335,7 @@ module Fog
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@port = options[:port] || Fog::Compute::VcloudDirector::Defaults::PORT @port = options[:port] || Fog::Compute::VcloudDirector::Defaults::PORT
@scheme = options[:scheme] || Fog::Compute::VcloudDirector::Defaults::SCHEME @scheme = options[:scheme] || Fog::Compute::VcloudDirector::Defaults::SCHEME
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
@end_point = "#{@scheme}://#{@host}#{@path}/" @end_point = "#{@scheme}://#{@host}#{@path}/"
@api_version = options[:vcloud_director_api_version] || Fog::Compute::VcloudDirector::Defaults::API_VERSION @api_version = options[:vcloud_director_api_version] || Fog::Compute::VcloudDirector::Defaults::API_VERSION
@show_progress = options[:vcloud_director_show_progress] @show_progress = options[:vcloud_director_show_progress]
@ -670,7 +670,7 @@ module Fog
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@port = options[:port] || Fog::Compute::VcloudDirector::Defaults::PORT @port = options[:port] || Fog::Compute::VcloudDirector::Defaults::PORT
@scheme = options[:scheme] || Fog::Compute::VcloudDirector::Defaults::SCHEME @scheme = options[:scheme] || Fog::Compute::VcloudDirector::Defaults::SCHEME
#@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) #@connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
@end_point = "#{@scheme}://#{@host}#{@path}/" @end_point = "#{@scheme}://#{@host}#{@path}/"
@api_version = options[:vcloud_director_api_version] || Fog::Compute::VcloudDirector::Defaults::API_VERSION @api_version = options[:vcloud_director_api_version] || Fog::Compute::VcloudDirector::Defaults::API_VERSION
end end

View file

@ -86,7 +86,7 @@ module Fog
@connection_options[:ssl_verify_peer] = false @connection_options[:ssl_verify_peer] = false
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def request(method_name, options = {}) def request(method_name, options = {})

View file

@ -164,7 +164,7 @@ module Fog
@host = options[:xenserver_pool_master] @host = options[:xenserver_pool_master]
@username = options[:xenserver_username] @username = options[:xenserver_username]
@password = options[:xenserver_password] @password = options[:xenserver_password]
@connection = Fog::Connection.new(@host) @connection = Fog::XML::Connection.new(@host)
@connection.authenticate(@username, @password) @connection.authenticate(@username, @password)
end end

View file

@ -79,7 +79,7 @@ module Fog
@persistent = options[:persistent] || false @persistent = options[:persistent] || false
@port = options[:port] || 80 @port = options[:port] || 80
@scheme = options[:scheme] || 'http' @scheme = options[:scheme] || 'http'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end end
def reload def reload