mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
remove deprecated service initializers
This commit is contained in:
parent
169557f280
commit
fadb437255
19 changed files with 9 additions and 151 deletions
|
@ -5,7 +5,7 @@ class AWS < Fog::Bin
|
|||
case key
|
||||
when :cdn
|
||||
Fog::AWS::CDN
|
||||
when :compute, :ec2
|
||||
when :compute
|
||||
Fog::AWS::Compute
|
||||
when :dns
|
||||
Fog::AWS::DNS
|
||||
|
@ -36,12 +36,6 @@ class AWS < Fog::Bin
|
|||
Fog::Compute.new(:provider => 'AWS')
|
||||
when :dns
|
||||
Fog::DNS.new(:provider => 'AWS')
|
||||
when :ec2
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] AWS[:ec2] is deprecated, use AWS[:compute] instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::Compute.new(:provider => 'AWS')
|
||||
when :elb
|
||||
Fog::AWS::ELB.new
|
||||
when :iam
|
||||
|
|
|
@ -3,7 +3,7 @@ class Bluebox < Fog::Bin
|
|||
|
||||
def class_for(key)
|
||||
case key
|
||||
when :blocks, :compute
|
||||
when :compute
|
||||
Fog::Bluebox::Compute
|
||||
else
|
||||
raise ArgumentError, "Unsupported #{self} service: #{key}"
|
||||
|
@ -13,12 +13,6 @@ class Bluebox < Fog::Bin
|
|||
def [](service)
|
||||
@@connections ||= Hash.new do |hash, key|
|
||||
hash[key] = case key
|
||||
when :blocks
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Bluebox[:blocks] is deprecated, use Bluebox[:compute] instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::Compute.new(:provider => 'Bluebox')
|
||||
when :compute
|
||||
Fog::Compute.new(:provider => 'Bluebox')
|
||||
else
|
||||
|
|
|
@ -3,7 +3,7 @@ class GoGrid < Fog::Bin
|
|||
|
||||
def class_for(key)
|
||||
case key
|
||||
when :compute, :servers
|
||||
when :compute
|
||||
Fog::GoGrid::Compute
|
||||
else
|
||||
raise ArgumentError, "Unsupported #{self} service: #{key}"
|
||||
|
@ -15,12 +15,6 @@ class GoGrid < Fog::Bin
|
|||
hash[key] = case key
|
||||
when :compute
|
||||
Fog::Compute.new(:provider => 'GoGrid')
|
||||
when :servers
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] GoGrid[:servers] is deprecated, use GoGrid[:compute] instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::Compute.new(:provider => 'GoGrid')
|
||||
else
|
||||
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
||||
end
|
||||
|
|
|
@ -19,12 +19,6 @@ class Linode < Fog::Bin
|
|||
Fog::Compute.new(:provider => 'Linode')
|
||||
when :dns
|
||||
Fog::DNS.new(:provider => 'Linode')
|
||||
when :linode
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Linode[:linode] is deprecated, use Linode[:compute] instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::Compute.new(:provider => 'Linode')
|
||||
else
|
||||
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ class Local < Fog::Bin
|
|||
|
||||
def class_for(key)
|
||||
case key
|
||||
when :files, :storage
|
||||
when :storage
|
||||
Fog::Local::Storage
|
||||
else
|
||||
raise ArgumentError, "Unsupported #{self} service: #{key}"
|
||||
|
@ -13,12 +13,6 @@ class Local < Fog::Bin
|
|||
def [](service)
|
||||
@@connections ||= Hash.new do |hash, key|
|
||||
hash[key] = case key
|
||||
when :files
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Local[:files] is deprecated, use Local[:storage] instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::Storage.new(:provider => 'Local')
|
||||
when :storage
|
||||
Fog::Storage.new(:provider => 'Local')
|
||||
else
|
||||
|
|
|
@ -3,7 +3,7 @@ class NewServers < Fog::Bin
|
|||
|
||||
def class_for(key)
|
||||
case key
|
||||
when :compute, :new_servers
|
||||
when :compute
|
||||
Fog::NewServers::Compute
|
||||
else
|
||||
raise ArgumentError, "Unsupported #{self} service: #{key}"
|
||||
|
@ -15,12 +15,6 @@ class NewServers < Fog::Bin
|
|||
hash[key] = case key
|
||||
when :compute
|
||||
Fog::Compute.new(:provider => 'NewServers')
|
||||
when :new_servers
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] NewServers[:new_servers] is deprecated, use NewServers[:compute] instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::Compute.new(:provider => 'NewServers')
|
||||
else
|
||||
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
||||
end
|
||||
|
|
|
@ -5,9 +5,9 @@ class Rackspace < Fog::Bin
|
|||
case key
|
||||
when :cdn
|
||||
Fog::Rackspace::CDN
|
||||
when :compute, :servers
|
||||
when :compute
|
||||
Fog::Rackspace::Compute
|
||||
when :files, :storage
|
||||
when :storage
|
||||
Fog::Rackspace::Storage
|
||||
else
|
||||
raise ArgumentError, "Unrecognized service: #{key}"
|
||||
|
@ -23,18 +23,6 @@ class Rackspace < Fog::Bin
|
|||
Fog::Compute.new(:provider => 'Rackspace')
|
||||
when :dns
|
||||
Fog::DNS.new(:provider => 'Rackspace')
|
||||
when :files
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Rackspace[:files] is deprecated, use Rackspace[:storage] instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::Storage.new(:provider => 'Rackspace')
|
||||
when :servers
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Rackspace[:servers] is deprecated, use Rackspace[:compute] instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::Compute.new(:provider => Rackspace)
|
||||
when :storage
|
||||
Fog::Storage.new(:provider => 'Rackspace')
|
||||
else
|
||||
|
|
|
@ -3,7 +3,7 @@ class Slicehost < Fog::Bin
|
|||
|
||||
def class_for(key)
|
||||
case key
|
||||
when :compute, :slices
|
||||
when :compute
|
||||
Fog::Slicehost::Compute
|
||||
when :dns
|
||||
Fog::Slicehost::DNS
|
||||
|
@ -14,14 +14,8 @@ class Slicehost < Fog::Bin
|
|||
|
||||
def [](service)
|
||||
@@connections ||= Hash.new do |hash, key|
|
||||
if key == :slices
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Slicehost[:blocks] is deprecated, use Bluebox[:compute] instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
end
|
||||
hash[key] = case key
|
||||
when :compute, :slices
|
||||
when :compute
|
||||
Fog::Compute.new(:provider => 'Slicehost')
|
||||
when :dns
|
||||
Fog::DNS.new(:provider => 'Slicehost')
|
||||
|
|
|
@ -2,14 +2,11 @@ class Terremark < Fog::Bin
|
|||
class << self
|
||||
|
||||
def available?
|
||||
Fog::Terremark::ECLOUD_OPTIONS.all? {|requirement| Fog.credentials.include?(requirement)} ||
|
||||
Fog::Terremark::VCLOUD_OPTIONS.all? {|requirement| Fog.credentials.include?(requirement)}
|
||||
end
|
||||
|
||||
def terremark_service(service)
|
||||
case service
|
||||
when :ecloud
|
||||
Fog::Terremark::Ecloud
|
||||
when :vcloud
|
||||
Fog::Terremark::Vcloud
|
||||
else
|
||||
|
@ -21,8 +18,6 @@ class Terremark < Fog::Bin
|
|||
@@connections ||= Hash.new do |hash, key|
|
||||
credentials = Fog.credentials.reject do |k,v|
|
||||
case key
|
||||
when :ecloud
|
||||
!Fog::Terremark::ECLOUD_OPTIONS.include?(k)
|
||||
when :vcloud
|
||||
!Fog::Terremark::VCLOUD_OPTIONS.include?(k)
|
||||
end
|
||||
|
|
|
@ -1,19 +1,3 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
|
||||
def self.new(attributes = {})
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Fog::AWS::EC2#new is deprecated, use Fog::AWS::Compute#new instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::AWS::Compute.new(attributes)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class Compute < Fog::Service
|
||||
|
|
|
@ -11,7 +11,6 @@ module Fog
|
|||
service(:cdn, 'cdn/aws')
|
||||
service(:compute, 'compute/aws')
|
||||
service(:dns, 'dns/aws')
|
||||
service(:ec2, 'compute/aws')
|
||||
service(:elb, 'aws/elb')
|
||||
service(:iam, 'aws/iam')
|
||||
service(:s3, 'storage/aws')
|
||||
|
|
|
@ -7,13 +7,5 @@ module Fog
|
|||
|
||||
service(:compute, 'compute/bluebox')
|
||||
|
||||
def self.new(attributes = {})
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Fog::Bluebox#new is deprecated, use Fog::Bluebox::Compute#new instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::Bluebox::Compute.new(attributes)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,13 +7,5 @@ module Fog
|
|||
|
||||
service(:compute, 'compute/go_grid')
|
||||
|
||||
def self.new(attributes = {})
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Fog::GoGrid#new is deprecated, use Fog::GoGrid::Compute#new instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::GoGrid::Compute.new(attributes)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,14 +8,6 @@ module Fog
|
|||
service(:compute, 'compute/linode')
|
||||
service(:dns, 'dns/linode')
|
||||
|
||||
def self.new(attributes = {})
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Fog::Linode#new is deprecated, use Fog::Linode::Compute#new instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::Linode::Compute.new(attributes)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -7,13 +7,5 @@ module Fog
|
|||
|
||||
service(:storage, 'storage/local')
|
||||
|
||||
def self.new(attributes = {})
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Fog::Local#new is deprecated, use Fog::Local::Storage#new instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::Local::Storage.new(attributes)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,13 +10,5 @@ module Fog
|
|||
|
||||
service(:compute, 'compute/new_servers')
|
||||
|
||||
def self.new(attributes = {})
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Fog::NewServers#new is deprecated, use Fog::NewServers::Compute#new instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::NewServers::Compute.new(attributes)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,8 +7,6 @@ module Fog
|
|||
|
||||
service(:cdn, 'cdn/rackspace')
|
||||
service(:compute, 'compute/rackspace')
|
||||
service(:files, 'storage/rackspace')
|
||||
service(:servers, 'compute/rackspace')
|
||||
service(:storage, 'storage/rackspace')
|
||||
|
||||
def self.authenticate(options)
|
||||
|
|
|
@ -11,13 +11,5 @@ module Fog
|
|||
service(:compute, 'compute/slicehost')
|
||||
service(:dns, 'dns/slicehost')
|
||||
|
||||
def self.new(attributes = {})
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Fog::Slicehost#new is deprecated, use Fog::Slicehost::Compute#new instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::Slicehost::Compute.new(attributes)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,19 +1,3 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class S3
|
||||
|
||||
def self.new(attributes = {})
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Fog::AWS::S3#new is deprecated, use Fog::AWS::Storage#new instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::AWS::Storage.new(attributes)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class Storage < Fog::Service
|
||||
|
|
Loading…
Reference in a new issue