mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Switch from NewServers to BareMetalCloud for #773
Includes changing from new_servers to bare_metal_cloud as well as newservers to baremetalcloud.
This commit is contained in:
parent
02408c5e88
commit
3a17e5174b
17 changed files with 40 additions and 40 deletions
|
@ -602,8 +602,8 @@ MVP! Patrick Debois
|
||||||
[compute|linode]
|
[compute|linode]
|
||||||
move linode compute to its own shared area (namespacing should probably be corrected). thanks geemus
|
move linode compute to its own shared area (namespacing should probably be corrected). thanks geemus
|
||||||
|
|
||||||
[compute|new_servers]
|
[compute|bare_metal_cloud]
|
||||||
move new_servers compute to its own shared area (namespacing should probably be corrected). thanks geemus
|
move bare_metal_cloud compute to its own shared area (namespacing should probably be corrected). thanks geemus
|
||||||
|
|
||||||
[compute|ninefold]
|
[compute|ninefold]
|
||||||
move ninefold compute to its own shared area (namespacing should probably be corrected). thanks geemus
|
move ninefold compute to its own shared area (namespacing should probably be corrected). thanks geemus
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
require(File.expand_path(File.join(File.dirname(__FILE__), 'core')))
|
require(File.expand_path(File.join(File.dirname(__FILE__), 'core')))
|
||||||
|
|
||||||
module Fog
|
module Fog
|
||||||
module NewServers
|
module BareMetalCloud
|
||||||
|
|
||||||
extend Fog::Provider
|
extend Fog::Provider
|
||||||
|
|
||||||
service(:compute, 'new_servers/compute', 'Compute')
|
service(:compute, 'bare_metal_cloud/compute', 'Compute')
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -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'
|
require 'fog/compute'
|
||||||
|
|
||||||
module Fog
|
module Fog
|
||||||
module Compute
|
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
|
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 :add_server
|
||||||
request :cancel_server
|
request :cancel_server
|
||||||
request :get_server
|
request :get_server
|
||||||
|
@ -32,15 +32,15 @@ module Fog
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(options={})
|
def initialize(options={})
|
||||||
@new_server_username = options[:new_servers_username]
|
@bare_metal_cloud_username = options[:bare_metal_cloud_username]
|
||||||
end
|
end
|
||||||
|
|
||||||
def data
|
def data
|
||||||
self.class.data[@new_server_username]
|
self.class.data[@bare_metal_cloud_username]
|
||||||
end
|
end
|
||||||
|
|
||||||
def reset_data
|
def reset_data
|
||||||
self.class.data.delete(@new_server_username)
|
self.class.data.delete(@bare_metal_cloud_username)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -50,10 +50,10 @@ module Fog
|
||||||
def initialize(options={})
|
def initialize(options={})
|
||||||
require 'fog/core/parser'
|
require 'fog/core/parser'
|
||||||
|
|
||||||
@new_servers_password = options[:new_servers_password]
|
@bare_metal_cloud_password = options[:bare_metal_cloud_password]
|
||||||
@new_servers_username = options[:new_servers_username]
|
@bare_metal_cloud_username = options[:bare_metal_cloud_username]
|
||||||
@connection_options = options[:connection_options] || {}
|
@connection_options = options[:connection_options] || {}
|
||||||
@host = options[:host] || "noc.newservers.com"
|
@host = options[:host] || "noc.baremetalcloud.com"
|
||||||
@persistent = options[:persistent] || false
|
@persistent = options[:persistent] || false
|
||||||
@port = options[:port] || 443
|
@port = options[:port] || 443
|
||||||
@scheme = options[:scheme] || 'https'
|
@scheme = options[:scheme] || 'https'
|
||||||
|
@ -67,8 +67,8 @@ module Fog
|
||||||
def request(params)
|
def request(params)
|
||||||
params[:query] ||= {}
|
params[:query] ||= {}
|
||||||
params[:query].merge!({
|
params[:query].merge!({
|
||||||
:password => @new_servers_password,
|
:password => @bare_metal_cloud_password,
|
||||||
:username => @new_servers_username
|
:username => @bare_metal_cloud_username
|
||||||
})
|
})
|
||||||
params[:headers] ||= {}
|
params[:headers] ||= {}
|
||||||
case params[:method]
|
case params[:method]
|
||||||
|
@ -83,7 +83,7 @@ module Fog
|
||||||
rescue Excon::Errors::HTTPStatusError => error
|
rescue Excon::Errors::HTTPStatusError => error
|
||||||
raise case error
|
raise case error
|
||||||
when Excon::Errors::NotFound
|
when Excon::Errors::NotFound
|
||||||
Fog::Compute::NewServers::NotFound.slurp(error)
|
Fog::Compute::BareMetalCloud::NotFound.slurp(error)
|
||||||
else
|
else
|
||||||
error
|
error
|
||||||
end
|
end
|
|
@ -1,6 +1,6 @@
|
||||||
module Fog
|
module Fog
|
||||||
module Compute
|
module Compute
|
||||||
class NewServers
|
class BareMetalCloud
|
||||||
class Real
|
class Real
|
||||||
|
|
||||||
# Boot a new server
|
# Boot a new server
|
|
@ -1,6 +1,6 @@
|
||||||
module Fog
|
module Fog
|
||||||
module Compute
|
module Compute
|
||||||
class NewServers
|
class BareMetalCloud
|
||||||
class Real
|
class Real
|
||||||
|
|
||||||
# Shutdown a running server
|
# Shutdown a running server
|
|
@ -1,6 +1,6 @@
|
||||||
module Fog
|
module Fog
|
||||||
module Compute
|
module Compute
|
||||||
class NewServers
|
class BareMetalCloud
|
||||||
class Real
|
class Real
|
||||||
|
|
||||||
# List servers
|
# List servers
|
|
@ -1,6 +1,6 @@
|
||||||
module Fog
|
module Fog
|
||||||
module Compute
|
module Compute
|
||||||
class NewServers
|
class BareMetalCloud
|
||||||
class Real
|
class Real
|
||||||
|
|
||||||
# List images
|
# List images
|
|
@ -1,6 +1,6 @@
|
||||||
module Fog
|
module Fog
|
||||||
module Compute
|
module Compute
|
||||||
class NewServers
|
class BareMetalCloud
|
||||||
class Real
|
class Real
|
||||||
|
|
||||||
# List available plans
|
# List available plans
|
|
@ -1,6 +1,6 @@
|
||||||
module Fog
|
module Fog
|
||||||
module Compute
|
module Compute
|
||||||
class NewServers
|
class BareMetalCloud
|
||||||
class Real
|
class Real
|
||||||
|
|
||||||
# List servers
|
# List servers
|
|
@ -1,6 +1,6 @@
|
||||||
module Fog
|
module Fog
|
||||||
module Compute
|
module Compute
|
||||||
class NewServers
|
class BareMetalCloud
|
||||||
class Real
|
class Real
|
||||||
|
|
||||||
# Reboot a running server
|
# Reboot a running server
|
|
@ -68,7 +68,7 @@ require 'fog/bin/joyent'
|
||||||
require 'fog/bin/libvirt'
|
require 'fog/bin/libvirt'
|
||||||
require 'fog/bin/linode'
|
require 'fog/bin/linode'
|
||||||
require 'fog/bin/local'
|
require 'fog/bin/local'
|
||||||
require 'fog/bin/new_servers'
|
require 'fog/bin/bare_metal_cloud'
|
||||||
require 'fog/bin/ninefold'
|
require 'fog/bin/ninefold'
|
||||||
require 'fog/bin/rackspace'
|
require 'fog/bin/rackspace'
|
||||||
require 'fog/bin/openstack'
|
require 'fog/bin/openstack'
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
class NewServers < Fog::Bin
|
class BareMetalCloud < Fog::Bin
|
||||||
class << self
|
class << self
|
||||||
|
|
||||||
def class_for(key)
|
def class_for(key)
|
||||||
case key
|
case key
|
||||||
when :compute
|
when :compute
|
||||||
Fog::Compute::NewServers
|
Fog::Compute::BareMetalCloud
|
||||||
else
|
else
|
||||||
raise ArgumentError, "Unsupported #{self} service: #{key}"
|
raise ArgumentError, "Unsupported #{self} service: #{key}"
|
||||||
end
|
end
|
||||||
|
@ -14,8 +14,8 @@ class NewServers < Fog::Bin
|
||||||
@@connections ||= Hash.new do |hash, key|
|
@@connections ||= Hash.new do |hash, key|
|
||||||
hash[key] = case key
|
hash[key] = case key
|
||||||
when :compute
|
when :compute
|
||||||
Fog::Logger.warning("NewServers[:compute] is not recommended, use Compute[:newservers] for portability")
|
Fog::Logger.warning("BareMetalCloud[:compute] is not recommended, use Compute[:baremetalcloud] for portability")
|
||||||
Fog::Compute.new(:provider => 'NewServers')
|
Fog::Compute.new(:provider => 'BareMetalCloud')
|
||||||
else
|
else
|
||||||
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
||||||
end
|
end
|
||||||
|
@ -24,7 +24,7 @@ class NewServers < Fog::Bin
|
||||||
end
|
end
|
||||||
|
|
||||||
def services
|
def services
|
||||||
Fog::NewServers.services
|
Fog::BareMetalCloud.services
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -41,9 +41,9 @@ module Fog
|
||||||
when :linode
|
when :linode
|
||||||
require 'fog/linode/compute'
|
require 'fog/linode/compute'
|
||||||
Fog::Compute::Linode.new(attributes)
|
Fog::Compute::Linode.new(attributes)
|
||||||
when :newservers
|
when :baremetalcloud
|
||||||
require 'fog/new_servers/compute'
|
require 'fog/bare_metal_cloud/compute'
|
||||||
Fog::Compute::NewServers.new(attributes)
|
Fog::Compute::BareMetalCloud.new(attributes)
|
||||||
when :ninefold
|
when :ninefold
|
||||||
require 'fog/ninefold/compute'
|
require 'fog/ninefold/compute'
|
||||||
Fog::Compute::Ninefold.new(attributes)
|
Fog::Compute::Ninefold.new(attributes)
|
||||||
|
|
|
@ -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:
|
:google_storage_secret_access_key:
|
||||||
:linode_api_key:
|
:linode_api_key:
|
||||||
:local_root:
|
:local_root:
|
||||||
:new_servers_password:
|
:bare_metal_cloud_password:
|
||||||
:new_servers_username:
|
:bare_metal_cloud_username:
|
||||||
:public_key_path:
|
:public_key_path:
|
||||||
:private_key_path:
|
:private_key_path:
|
||||||
:openstack_api_key:
|
:openstack_api_key:
|
||||||
|
|
|
@ -14,7 +14,7 @@ require 'fog/joyent'
|
||||||
require 'fog/libvirt'
|
require 'fog/libvirt'
|
||||||
require 'fog/linode'
|
require 'fog/linode'
|
||||||
require 'fog/local'
|
require 'fog/local'
|
||||||
require 'fog/new_servers'
|
require 'fog/bare_metal_cloud'
|
||||||
require 'fog/ninefold'
|
require 'fog/ninefold'
|
||||||
require 'fog/rackspace'
|
require 'fog/rackspace'
|
||||||
require 'fog/openstack'
|
require 'fog/openstack'
|
||||||
|
|
|
@ -12,7 +12,7 @@ def array_differences(array_a, array_b)
|
||||||
end
|
end
|
||||||
|
|
||||||
# check to see which credentials are available and add others to the skipped tags list
|
# 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}
|
available_providers = Fog.available_providers.map {|provider| provider.downcase}
|
||||||
for provider in (all_providers - available_providers)
|
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)[/]")
|
Formatador.display_line("[yellow]Skipping tests for [bold]#{provider}[/] [yellow]due to lacking credentials (add some to '~/.fog' to run them)[/]")
|
||||||
|
|
|
@ -34,8 +34,8 @@ if Fog.mock?
|
||||||
:joyent_password => "joyentpass",
|
:joyent_password => "joyentpass",
|
||||||
:linode_api_key => 'linode_api_key',
|
:linode_api_key => 'linode_api_key',
|
||||||
:local_root => '~/.fog',
|
:local_root => '~/.fog',
|
||||||
:new_servers_password => 'new_servers_password',
|
:bare_metal_cloud_password => 'bare_metal_cloud_password',
|
||||||
:new_servers_username => 'new_servers_username',
|
:bare_metal_cloud_username => 'bare_metal_cloud_username',
|
||||||
:ninefold_compute_key => 'ninefold_compute_key',
|
:ninefold_compute_key => 'ninefold_compute_key',
|
||||||
:ninefold_compute_secret => 'ninefold_compute_secret',
|
:ninefold_compute_secret => 'ninefold_compute_secret',
|
||||||
:ninefold_storage_secret => 'ninefold_storage_secret',
|
:ninefold_storage_secret => 'ninefold_storage_secret',
|
||||||
|
|
Loading…
Add table
Reference in a new issue