diff --git a/lib/fog/bluebox/bin.rb b/lib/fog/bluebox/bin.rb index fec439fe1..91dace601 100644 --- a/lib/fog/bluebox/bin.rb +++ b/lib/fog/bluebox/bin.rb @@ -10,6 +10,12 @@ module Bluebox 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::Bluebox::Compute.new when :compute Fog::Bluebox::Compute.new end diff --git a/lib/fog/bluebox/compute.rb b/lib/fog/bluebox/compute.rb index 4953909a8..a374c1f70 100644 --- a/lib/fog/bluebox/compute.rb +++ b/lib/fog/bluebox/compute.rb @@ -72,7 +72,7 @@ module Fog rescue Excon::Errors::Error => error raise case error when Excon::Errors::NotFound - Fog::Bluebox::NotFound.slurp(error) + Fog::Bluebox::Compute::NotFound.slurp(error) else error end diff --git a/lib/fog/bluebox/models/compute/flavors.rb b/lib/fog/bluebox/models/compute/flavors.rb index 6abae1205..9bef38ff1 100644 --- a/lib/fog/bluebox/models/compute/flavors.rb +++ b/lib/fog/bluebox/models/compute/flavors.rb @@ -1,5 +1,5 @@ require 'fog/collection' -require 'fog/bluebox/models/flavor' +require 'fog/bluebox/models/compute/flavor' module Fog module Bluebox @@ -7,7 +7,7 @@ module Fog class Flavors < Fog::Collection - model Fog::Bluebox::Flavor + model Fog::Bluebox::Compute::Flavor def all data = connection.get_products.body @@ -17,7 +17,7 @@ module Fog def get(product_id) response = connection.get_product(product_id) new(response.body) - rescue Fog::Bluebox::NotFound + rescue Fog::Bluebox::Compute::NotFound nil end diff --git a/lib/fog/bluebox/models/compute/images.rb b/lib/fog/bluebox/models/compute/images.rb index fca385b08..9b13fef77 100644 --- a/lib/fog/bluebox/models/compute/images.rb +++ b/lib/fog/bluebox/models/compute/images.rb @@ -1,5 +1,5 @@ require 'fog/collection' -require 'fog/bluebox/models/image' +require 'fog/bluebox/models/compute/image' module Fog module Bluebox @@ -7,7 +7,7 @@ module Fog class Images < Fog::Collection - model Fog::Bluebox::Image + model Fog::Bluebox::Compute::Image def all data = connection.get_templates.body @@ -17,7 +17,7 @@ module Fog def get(template_id) response = connection.get_template(template_id) new(response.body) - rescue Fog::Bluebox::NotFound + rescue Fog::Bluebox::Compute::NotFound nil end diff --git a/lib/fog/bluebox/models/compute/servers.rb b/lib/fog/bluebox/models/compute/servers.rb index 2858e04ab..042411dd0 100644 --- a/lib/fog/bluebox/models/compute/servers.rb +++ b/lib/fog/bluebox/models/compute/servers.rb @@ -1,5 +1,5 @@ require 'fog/collection' -require 'fog/bluebox/models/server' +require 'fog/bluebox/models/compute/server' module Fog module Bluebox @@ -7,7 +7,7 @@ module Fog class Servers < Fog::Collection - model Fog::Bluebox::Server + model Fog::Bluebox::Compute::Server def all data = connection.get_blocks.body @@ -18,7 +18,7 @@ module Fog if server_id && server = connection.get_block(server_id).body new(server) end - rescue Fog::Bluebox::NotFound + rescue Fog::Bluebox::Compute::NotFound nil end diff --git a/lib/fog/go_grid/bin.rb b/lib/fog/go_grid/bin.rb index 3f5b95ae4..bec602cc7 100644 --- a/lib/fog/go_grid/bin.rb +++ b/lib/fog/go_grid/bin.rb @@ -11,6 +11,12 @@ module GoGrid hash[key] = case key when :compute Fog::GoGrid::Compute.new + 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::GoGrid::Compute.new end end @@connections[service] diff --git a/lib/fog/go_grid/compute.rb b/lib/fog/go_grid/compute.rb index b24f8b592..3e3a5c43f 100644 --- a/lib/fog/go_grid/compute.rb +++ b/lib/fog/go_grid/compute.rb @@ -79,7 +79,7 @@ module Fog rescue Excon::Errors::Error => error raise case error when Excon::Errors::NotFound - Fog::Go_Grid::NotFound.slurp(error) + Fog::GoGrid::Compute::NotFound.slurp(error) else error end diff --git a/lib/fog/linode/bin.rb b/lib/fog/linode/bin.rb index e41494172..82f40afa7 100644 --- a/lib/fog/linode/bin.rb +++ b/lib/fog/linode/bin.rb @@ -11,6 +11,12 @@ module Linode hash[key] = case key when :compute Fog::Linode::Compute.new + 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::Linode::Compute.new end end @@connections[service] diff --git a/lib/fog/linode/compute.rb b/lib/fog/linode/compute.rb index 828a8cab0..e6479c392 100644 --- a/lib/fog/linode/compute.rb +++ b/lib/fog/linode/compute.rb @@ -65,9 +65,9 @@ module Fog if data = response.body['ERRORARRAY'].first error = case data['ERRORCODE'] when 5 - Fog::Linode::NotFound + Fog::Linode::Compute::NotFound else - Fog::Linode::Error + Fog::Linode::Compute::Error end raise error.new(data['ERRORMESSAGE']) end diff --git a/lib/fog/local/bin.rb b/lib/fog/local/bin.rb index 43ff9754c..c8930ca68 100644 --- a/lib/fog/local/bin.rb +++ b/lib/fog/local/bin.rb @@ -9,6 +9,12 @@ module Local 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::Local::Storage.new when :storage Fog::Local::Storage.new end diff --git a/lib/fog/local/models/storage/directory.rb b/lib/fog/local/models/storage/directory.rb index 9b3ab7d9d..cbf33d67e 100644 --- a/lib/fog/local/models/storage/directory.rb +++ b/lib/fog/local/models/storage/directory.rb @@ -1,5 +1,5 @@ require 'fog/model' -# require 'fog/local/models/files' +require 'fog/local/models/storage/files' module Fog module Local diff --git a/lib/fog/local/models/storage/files.rb b/lib/fog/local/models/storage/files.rb index 45d1be262..06889137f 100644 --- a/lib/fog/local/models/storage/files.rb +++ b/lib/fog/local/models/storage/files.rb @@ -1,5 +1,5 @@ require 'fog/collection' -require 'fog/local/models/file' +require 'fog/local/models/storage/file' module Fog module Local diff --git a/lib/fog/new_servers/bin.rb b/lib/fog/new_servers/bin.rb index 36850ffc6..7d805eb8e 100644 --- a/lib/fog/new_servers/bin.rb +++ b/lib/fog/new_servers/bin.rb @@ -11,6 +11,12 @@ module NewServers hash[key] = case key when :compute Fog::NewServers::Compute.new + when :new_servers + location = caller.first + warning = "[yellow][WARN] NewServers[:servers] is deprecated, use NewServers[:compute] instead[/]" + warning << " [light_black](" << location << ")[/] " + Formatador.display_line(warning) + Fog::NewServers::Compute.new end end @@connections[service] diff --git a/lib/fog/new_servers/compute.rb b/lib/fog/new_servers/compute.rb index 3989bdd42..c735be5ac 100644 --- a/lib/fog/new_servers/compute.rb +++ b/lib/fog/new_servers/compute.rb @@ -75,7 +75,7 @@ module Fog rescue Excon::Errors::Error => error raise case error when Excon::Errors::NotFound - Fog::NewServers::NotFound.slurp(error) + Fog::NewServers::Compute::NotFound.slurp(error) else error end diff --git a/lib/fog/rackspace/bin.rb b/lib/fog/rackspace/bin.rb index 4fc1a5c0f..0e371ccc0 100644 --- a/lib/fog/rackspace/bin.rb +++ b/lib/fog/rackspace/bin.rb @@ -11,6 +11,18 @@ module Rackspace hash[key] = case key when :compute Fog::Rackspace::Compute.new + 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::Rackspace::Storage.new + 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::Rackspace::Compute.new when :storage Fog::Rackspace::Storage.new end diff --git a/lib/fog/rackspace/models/compute/flavors.rb b/lib/fog/rackspace/models/compute/flavors.rb index 1416b27f9..ff4668192 100644 --- a/lib/fog/rackspace/models/compute/flavors.rb +++ b/lib/fog/rackspace/models/compute/flavors.rb @@ -1,5 +1,5 @@ require 'fog/collection' -require 'fog/rackspace/models/servers/flavor' +require 'fog/rackspace/models/compute/flavor' module Fog module Rackspace diff --git a/lib/fog/rackspace/models/compute/images.rb b/lib/fog/rackspace/models/compute/images.rb index 7633a0405..ded81dace 100644 --- a/lib/fog/rackspace/models/compute/images.rb +++ b/lib/fog/rackspace/models/compute/images.rb @@ -1,5 +1,5 @@ require 'fog/collection' -require 'fog/rackspace/models/servers/image' +require 'fog/rackspace/models/compute/image' module Fog module Rackspace diff --git a/lib/fog/rackspace/models/compute/servers.rb b/lib/fog/rackspace/models/compute/servers.rb index d963870b1..43d9acfaa 100644 --- a/lib/fog/rackspace/models/compute/servers.rb +++ b/lib/fog/rackspace/models/compute/servers.rb @@ -1,5 +1,5 @@ require 'fog/collection' -require 'fog/rackspace/models/servers/server' +require 'fog/rackspace/models/compute/server' module Fog module Rackspace diff --git a/lib/fog/rackspace/models/storage/directory.rb b/lib/fog/rackspace/models/storage/directory.rb index 51d4e7e14..8bf800ae9 100644 --- a/lib/fog/rackspace/models/storage/directory.rb +++ b/lib/fog/rackspace/models/storage/directory.rb @@ -1,5 +1,5 @@ require 'fog/model' -require 'fog/rackspace/models/files/files' +require 'fog/rackspace/models/storage/files' module Fog module Rackspace @@ -25,7 +25,7 @@ module Fog def files @files ||= begin - Fog::Rackspace::Files::Files.new( + Fog::Rackspace::Storage::Files.new( :directory => self, :connection => connection ) diff --git a/lib/fog/rackspace/models/storage/files.rb b/lib/fog/rackspace/models/storage/files.rb index 4674bcb20..55f7c3a74 100644 --- a/lib/fog/rackspace/models/storage/files.rb +++ b/lib/fog/rackspace/models/storage/files.rb @@ -1,5 +1,5 @@ require 'fog/collection' -require 'fog/rackspace/models/files/file' +require 'fog/rackspace/models/storage/file' module Fog module Rackspace