Skip to content

Commit

Permalink
Merge pull request fog#2711 from fog/connection_deprecation_warning
Browse files Browse the repository at this point in the history
[core] Deprecate Fog::Connection
  • Loading branch information
tokengeek committed Feb 27, 2014
2 parents 573ae32 + 0e1daf3 commit 7a152a2
Show file tree
Hide file tree
Showing 94 changed files with 156 additions and 112 deletions.
2 changes: 1 addition & 1 deletion lib/fog/atmos/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def initialize(options={})
@hmac = Fog::HMAC.new('sha1', @storage_secret_decoded)
@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)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/auto_scaling.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def initialize(options={})
@port = options[:port] || 443
@persistent = options[:persistent] || false
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/beanstalk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/cdn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def initialize(options={})
@port = options[:port] || 443
@scheme = options[:scheme] || 'https'
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/cloud_formation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/cloud_watch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/compute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def initialize(options={})
@port = options[:port] || 443
@scheme = options[:scheme] || 'https'
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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/data_pipeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/dns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def initialize(options={})
@scheme = options[:scheme] || 'https'
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/dynamodb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def initialize(options={})
@port = options[:port] || '443'
@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

private
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/elasticache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def initialize(options={})
@path = options[:path] || '/'
@port = options[:port] || 443
@scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new(
@connection = Fog::XML::Connection.new(
"#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent]
)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/elb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/emr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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]
end

Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/glacier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def initialize(options={})
@port = options[:port] || 443
@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


Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/iam.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/rds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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'
end

Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/redshift.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def initialize(options={})
@port = options[:port] || 443
@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


Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/ses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/simpledb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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

private
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/sns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/sqs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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

def reload
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def connection(scheme, host, port)
else
@connection = nil
end
@connection ||= Fog::Connection.new(uri, @persistent, @connection_options)
@connection ||= Fog::XML::Connection.new(uri, @persistent, @connection_options)
end

def request(params, &block)
Expand All @@ -550,7 +550,7 @@ def request(params, &block)
headers = (error.response.is_a?(Hash) ? error.response[:headers] : error.response.headers)
uri = URI.parse(headers['Location'])
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

response
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/sts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/bare_metal_cloud/compute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/bluebox/blb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:bluebox_port] || 443
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/bluebox/compute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:bluebox_port] || 443
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/bluebox/dns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def initialize(options ={})
@persistent = options[:persistent] || false
@port = options[:bluebox_port] || 443
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/clodo/compute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def initialize(options={})
@clodo_must_reauthenticate = false
authenticate
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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/clodo/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def self.authenticate(options)
url = clodo_auth_url.match(/^https?:/) ? \
clodo_auth_url : 'https://' + clodo_auth_url
uri = URI.parse(url)
connection = Fog::Connection.new(url)
connection = Fog::XML::Connection.new(url)
@clodo_api_key = options[:clodo_api_key]
@clodo_username = options[:clodo_username]
response = connection.request({
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/cloudsigma/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def setup_connection(options)
@api_version = options[:cloudsigma_api_version] || '2.0'
@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

def request(params)
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/cloudstack/compute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def initialize(options={})
@path = options[:cloudstack_path] || '/client/api'
@port = options[:cloudstack_port] || 443
@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

def reload
Expand Down
9 changes: 5 additions & 4 deletions lib/fog/core/deprecated/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ module Fog
#
# @see https://github.com/geemus/excon/blob/master/lib/excon/connection.rb
#
class Connection < Fog::XML::SAXParserConnection
class Connection < Fog::XML::Connection
def request(params, &block)
if (parser = params.delete(:parser))
super(parser, params)
if params.key?(:parser)
Fog::Logger.deprecation("Fog::XML::Connection is deprecated use Fog::XML::Connection instead [light_black](#{caller.first})[/]")
else
original_request(params)
Fog::Logger.deprecation("Fog::XML::Connection is deprecated use Fog::Core::Connection instead [light_black](#{caller.first})[/]")
end
super(params)
end
end
end
2 changes: 1 addition & 1 deletion lib/fog/digitalocean/compute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def initialize(options={})
@digitalocean_client_id = options[:digitalocean_client_id]
@digitalocean_api_url = options[:digitalocean_api_url] || \
"https://api.digitalocean.com"
@connection = Fog::Connection.new(@digitalocean_api_url)
@connection = Fog::XML::Connection.new(@digitalocean_api_url)
end

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/dnsimple/dns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/dnsmadeeasy/dns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def initialize(options={})
@persistent = options.fetch(:persistent, true)
@port = options[:port] || 80 #443 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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/dreamhost/dns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent)
@connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent)
end

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/dynect/dns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@scheme = options[:scheme] || 'https'
@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

def auth_token
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/ecloud/compute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def request(params)

# Hash connections on the host_url ... There's nothing to say we won't get URI's that go to
# 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.
headers = set_extra_headers_for(params) || set_extra_headers_for({})
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/glesys/compute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def initialize(options)
@glesys_api_key = options[:glesys_api_key] || Fog.credentials[:glesys_api_key]
@connection_options = options[:connection_options] || {}
@persistent = options[:persistent] || false
@connection = Fog::Connection.new(@api_url, @persistent, @connection_options)
@connection = Fog::XML::Connection.new(@api_url, @persistent, @connection_options)
end

def request(method_name, options = {})
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/go_grid/compute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def initialize(options={})
@persistent = options[:persistent] || false
@port = options[:port] || 443
@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

def reload
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/google/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def connection(scheme, host, port)
else
@connection = nil
end
@connection ||= Fog::Connection.new(uri, @persistent, @connection_options)
@connection ||= Fog::XML::Connection.new(uri, @persistent, @connection_options)
end

private
Expand Down
Loading

0 comments on commit 7a152a2

Please sign in to comment.