diff --git a/changelog.txt b/changelog.txt index 8372e0993..f1a34be36 100644 --- a/changelog.txt +++ b/changelog.txt @@ -602,8 +602,8 @@ MVP! Patrick Debois [compute|linode] move linode compute to its own shared area (namespacing should probably be corrected). thanks geemus -[compute|new_servers] - move new_servers compute to its own shared area (namespacing should probably be corrected). thanks geemus +[compute|bare_metal_cloud] + move bare_metal_cloud compute to its own shared area (namespacing should probably be corrected). thanks geemus [compute|ninefold] move ninefold compute to its own shared area (namespacing should probably be corrected). thanks geemus diff --git a/lib/fog/new_servers.rb b/lib/fog/bare_metal_cloud.rb similarity index 58% rename from lib/fog/new_servers.rb rename to lib/fog/bare_metal_cloud.rb index 9a7382657..68a83486e 100644 --- a/lib/fog/new_servers.rb +++ b/lib/fog/bare_metal_cloud.rb @@ -1,11 +1,11 @@ require(File.expand_path(File.join(File.dirname(__FILE__), 'core'))) module Fog - module NewServers + module BareMetalCloud extend Fog::Provider - service(:compute, 'new_servers/compute', 'Compute') + service(:compute, 'bare_metal_cloud/compute', 'Compute') end end diff --git a/lib/fog/new_servers/compute.rb b/lib/fog/bare_metal_cloud/compute.rb similarity index 69% rename from lib/fog/new_servers/compute.rb rename to lib/fog/bare_metal_cloud/compute.rb index a5449a4d6..a39bcef17 100644 --- a/lib/fog/new_servers/compute.rb +++ b/lib/fog/bare_metal_cloud/compute.rb @@ -1,16 +1,16 @@ -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'new_servers')) +require File.expand_path(File.join(File.dirname(__FILE__), '..', 'bare_metal_cloud')) require 'fog/compute' module Fog module Compute - class NewServers < Fog::Service + class BareMetalCloud < Fog::Service - requires :new_servers_password, :new_servers_username + requires :bare_metal_cloud_password, :bare_metal_cloud_username recognizes :host, :port, :scheme, :persistent - model_path 'fog/new_servers/models/compute' + model_path 'fog/bare_metal_cloud/models/compute' - request_path 'fog/new_servers/requests/compute' + request_path 'fog/bare_metal_cloud/requests/compute' request :add_server request :cancel_server request :get_server @@ -32,15 +32,15 @@ module Fog end def initialize(options={}) - @new_server_username = options[:new_servers_username] + @bare_metal_cloud_username = options[:bare_metal_cloud_username] end def data - self.class.data[@new_server_username] + self.class.data[@bare_metal_cloud_username] end def reset_data - self.class.data.delete(@new_server_username) + self.class.data.delete(@bare_metal_cloud_username) end end @@ -50,10 +50,10 @@ module Fog def initialize(options={}) require 'fog/core/parser' - @new_servers_password = options[:new_servers_password] - @new_servers_username = options[:new_servers_username] + @bare_metal_cloud_password = options[:bare_metal_cloud_password] + @bare_metal_cloud_username = options[:bare_metal_cloud_username] @connection_options = options[:connection_options] || {} - @host = options[:host] || "noc.newservers.com" + @host = options[:host] || "noc.baremetalcloud.com" @persistent = options[:persistent] || false @port = options[:port] || 443 @scheme = options[:scheme] || 'https' @@ -67,8 +67,8 @@ module Fog def request(params) params[:query] ||= {} params[:query].merge!({ - :password => @new_servers_password, - :username => @new_servers_username + :password => @bare_metal_cloud_password, + :username => @bare_metal_cloud_username }) params[:headers] ||= {} case params[:method] @@ -83,7 +83,7 @@ module Fog rescue Excon::Errors::HTTPStatusError => error raise case error when Excon::Errors::NotFound - Fog::Compute::NewServers::NotFound.slurp(error) + Fog::Compute::BareMetalCloud::NotFound.slurp(error) else error end diff --git a/lib/fog/new_servers/requests/compute/add_server.rb b/lib/fog/bare_metal_cloud/requests/compute/add_server.rb similarity index 97% rename from lib/fog/new_servers/requests/compute/add_server.rb rename to lib/fog/bare_metal_cloud/requests/compute/add_server.rb index 43f390eef..361559b2f 100644 --- a/lib/fog/new_servers/requests/compute/add_server.rb +++ b/lib/fog/bare_metal_cloud/requests/compute/add_server.rb @@ -1,6 +1,6 @@ module Fog module Compute - class NewServers + class BareMetalCloud class Real # Boot a new server diff --git a/lib/fog/new_servers/requests/compute/cancel_server.rb b/lib/fog/bare_metal_cloud/requests/compute/cancel_server.rb similarity index 96% rename from lib/fog/new_servers/requests/compute/cancel_server.rb rename to lib/fog/bare_metal_cloud/requests/compute/cancel_server.rb index 07703bdbe..cb4bece3f 100644 --- a/lib/fog/new_servers/requests/compute/cancel_server.rb +++ b/lib/fog/bare_metal_cloud/requests/compute/cancel_server.rb @@ -1,6 +1,6 @@ module Fog module Compute - class NewServers + class BareMetalCloud class Real # Shutdown a running server diff --git a/lib/fog/new_servers/requests/compute/get_server.rb b/lib/fog/bare_metal_cloud/requests/compute/get_server.rb similarity index 97% rename from lib/fog/new_servers/requests/compute/get_server.rb rename to lib/fog/bare_metal_cloud/requests/compute/get_server.rb index 6d4079309..18ffa6bc5 100644 --- a/lib/fog/new_servers/requests/compute/get_server.rb +++ b/lib/fog/bare_metal_cloud/requests/compute/get_server.rb @@ -1,6 +1,6 @@ module Fog module Compute - class NewServers + class BareMetalCloud class Real # List servers diff --git a/lib/fog/new_servers/requests/compute/list_images.rb b/lib/fog/bare_metal_cloud/requests/compute/list_images.rb similarity index 95% rename from lib/fog/new_servers/requests/compute/list_images.rb rename to lib/fog/bare_metal_cloud/requests/compute/list_images.rb index e1cd4449c..499d694c1 100644 --- a/lib/fog/new_servers/requests/compute/list_images.rb +++ b/lib/fog/bare_metal_cloud/requests/compute/list_images.rb @@ -1,6 +1,6 @@ module Fog module Compute - class NewServers + class BareMetalCloud class Real # List images diff --git a/lib/fog/new_servers/requests/compute/list_plans.rb b/lib/fog/bare_metal_cloud/requests/compute/list_plans.rb similarity index 96% rename from lib/fog/new_servers/requests/compute/list_plans.rb rename to lib/fog/bare_metal_cloud/requests/compute/list_plans.rb index 3d56292f4..9ca555f6a 100644 --- a/lib/fog/new_servers/requests/compute/list_plans.rb +++ b/lib/fog/bare_metal_cloud/requests/compute/list_plans.rb @@ -1,6 +1,6 @@ module Fog module Compute - class NewServers + class BareMetalCloud class Real # List available plans diff --git a/lib/fog/new_servers/requests/compute/list_servers.rb b/lib/fog/bare_metal_cloud/requests/compute/list_servers.rb similarity index 97% rename from lib/fog/new_servers/requests/compute/list_servers.rb rename to lib/fog/bare_metal_cloud/requests/compute/list_servers.rb index 564148eb6..0d3e9e509 100644 --- a/lib/fog/new_servers/requests/compute/list_servers.rb +++ b/lib/fog/bare_metal_cloud/requests/compute/list_servers.rb @@ -1,6 +1,6 @@ module Fog module Compute - class NewServers + class BareMetalCloud class Real # List servers diff --git a/lib/fog/new_servers/requests/compute/reboot_server.rb b/lib/fog/bare_metal_cloud/requests/compute/reboot_server.rb similarity index 95% rename from lib/fog/new_servers/requests/compute/reboot_server.rb rename to lib/fog/bare_metal_cloud/requests/compute/reboot_server.rb index bba64bafd..a695ee4ff 100644 --- a/lib/fog/new_servers/requests/compute/reboot_server.rb +++ b/lib/fog/bare_metal_cloud/requests/compute/reboot_server.rb @@ -1,6 +1,6 @@ module Fog module Compute - class NewServers + class BareMetalCloud class Real # Reboot a running server diff --git a/lib/fog/bin.rb b/lib/fog/bin.rb index 6eee1bdda..2476eb4d7 100644 --- a/lib/fog/bin.rb +++ b/lib/fog/bin.rb @@ -68,7 +68,7 @@ require 'fog/bin/joyent' require 'fog/bin/libvirt' require 'fog/bin/linode' require 'fog/bin/local' -require 'fog/bin/new_servers' +require 'fog/bin/bare_metal_cloud' require 'fog/bin/ninefold' require 'fog/bin/rackspace' require 'fog/bin/openstack' diff --git a/lib/fog/bin/new_servers.rb b/lib/fog/bin/bare_metal_cloud.rb similarity index 62% rename from lib/fog/bin/new_servers.rb rename to lib/fog/bin/bare_metal_cloud.rb index 522c1ff31..eef5ef4b2 100644 --- a/lib/fog/bin/new_servers.rb +++ b/lib/fog/bin/bare_metal_cloud.rb @@ -1,10 +1,10 @@ -class NewServers < Fog::Bin +class BareMetalCloud < Fog::Bin class << self def class_for(key) case key when :compute - Fog::Compute::NewServers + Fog::Compute::BareMetalCloud else raise ArgumentError, "Unsupported #{self} service: #{key}" end @@ -14,8 +14,8 @@ class NewServers < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :compute - Fog::Logger.warning("NewServers[:compute] is not recommended, use Compute[:newservers] for portability") - Fog::Compute.new(:provider => 'NewServers') + Fog::Logger.warning("BareMetalCloud[:compute] is not recommended, use Compute[:baremetalcloud] for portability") + Fog::Compute.new(:provider => 'BareMetalCloud') else raise ArgumentError, "Unrecognized service: #{key.inspect}" end @@ -24,7 +24,7 @@ class NewServers < Fog::Bin end def services - Fog::NewServers.services + Fog::BareMetalCloud.services end end diff --git a/lib/fog/compute.rb b/lib/fog/compute.rb index 60b64b8c3..e61524e1e 100644 --- a/lib/fog/compute.rb +++ b/lib/fog/compute.rb @@ -41,9 +41,9 @@ module Fog when :linode require 'fog/linode/compute' Fog::Compute::Linode.new(attributes) - when :newservers - require 'fog/new_servers/compute' - Fog::Compute::NewServers.new(attributes) + when :baremetalcloud + require 'fog/bare_metal_cloud/compute' + Fog::Compute::BareMetalCloud.new(attributes) when :ninefold require 'fog/ninefold/compute' Fog::Compute::Ninefold.new(attributes) diff --git a/lib/fog/core/errors.rb b/lib/fog/core/errors.rb index fc2884d69..d954a749c 100644 --- a/lib/fog/core/errors.rb +++ b/lib/fog/core/errors.rb @@ -46,8 +46,8 @@ An alternate file may be used by placing its path in the FOG_RC environment vari :google_storage_secret_access_key: :linode_api_key: :local_root: - :new_servers_password: - :new_servers_username: + :bare_metal_cloud_password: + :bare_metal_cloud_username: :public_key_path: :private_key_path: :openstack_api_key: diff --git a/lib/fog/providers.rb b/lib/fog/providers.rb index bd38da54d..8fd1f1f64 100644 --- a/lib/fog/providers.rb +++ b/lib/fog/providers.rb @@ -14,7 +14,7 @@ require 'fog/joyent' require 'fog/libvirt' require 'fog/linode' require 'fog/local' -require 'fog/new_servers' +require 'fog/bare_metal_cloud' require 'fog/ninefold' require 'fog/rackspace' require 'fog/openstack' diff --git a/tests/helper.rb b/tests/helper.rb index b9efdd97e..1af4b0944 100644 --- a/tests/helper.rb +++ b/tests/helper.rb @@ -12,7 +12,7 @@ def array_differences(array_a, array_b) end # check to see which credentials are available and add others to the skipped tags list -all_providers = ['aws', 'bluebox', 'brightbox', 'dnsimple', 'dnsmadeeasy', 'dynect', 'ecloud', 'glesys', 'gogrid', 'google', 'joyent', 'linode', 'local', 'ninefold', 'newservers', 'openstack', 'ovirt', 'rackspace', 'slicehost', 'stormondemand', 'voxel', 'vsphere', 'zerigo'] +all_providers = ['aws', 'bluebox', 'brightbox', 'dnsimple', 'dnsmadeeasy', 'dynect', 'ecloud', 'glesys', 'gogrid', 'google', 'joyent', 'linode', 'local', 'ninefold', 'baremetalcloud', 'openstack', 'ovirt', 'rackspace', 'slicehost', 'stormondemand', 'voxel', 'vsphere', 'zerigo'] available_providers = Fog.available_providers.map {|provider| provider.downcase} for provider in (all_providers - available_providers) Formatador.display_line("[yellow]Skipping tests for [bold]#{provider}[/] [yellow]due to lacking credentials (add some to '~/.fog' to run them)[/]") diff --git a/tests/helpers/mock_helper.rb b/tests/helpers/mock_helper.rb index bdb8aa9bf..295b6d60d 100644 --- a/tests/helpers/mock_helper.rb +++ b/tests/helpers/mock_helper.rb @@ -34,8 +34,8 @@ if Fog.mock? :joyent_password => "joyentpass", :linode_api_key => 'linode_api_key', :local_root => '~/.fog', - :new_servers_password => 'new_servers_password', - :new_servers_username => 'new_servers_username', + :bare_metal_cloud_password => 'bare_metal_cloud_password', + :bare_metal_cloud_username => 'bare_metal_cloud_username', :ninefold_compute_key => 'ninefold_compute_key', :ninefold_compute_secret => 'ninefold_compute_secret', :ninefold_storage_secret => 'ninefold_storage_secret',