mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
add slicehost to bin
This commit is contained in:
parent
7cafd6d2c1
commit
ca532db0be
1 changed files with 44 additions and 1 deletions
45
bin/fog
45
bin/fog
|
@ -127,12 +127,55 @@ module Rackspace
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module Slicehost
|
||||||
|
class << self
|
||||||
|
if Fog.credentials[:slicehost_password]
|
||||||
|
|
||||||
|
def ready?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
def [](service)
|
||||||
|
@@connections ||= Hash.new do |hash, key|
|
||||||
|
credentials = Fog.credentials.reject do |k,v|
|
||||||
|
![:slicehost_password].include?(k)
|
||||||
|
end
|
||||||
|
hash[key] = case key
|
||||||
|
when :slices
|
||||||
|
Fog::Slicehost.new(credentials)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@@connections[service]
|
||||||
|
end
|
||||||
|
|
||||||
|
def flavors
|
||||||
|
self[:slices].flavors
|
||||||
|
end
|
||||||
|
|
||||||
|
def images
|
||||||
|
self[:slices].images
|
||||||
|
end
|
||||||
|
|
||||||
|
def servers
|
||||||
|
self[:slices].servers
|
||||||
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
def ready?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
module Fog
|
module Fog
|
||||||
class << self
|
class << self
|
||||||
|
|
||||||
def services
|
def services
|
||||||
services = []
|
services = []
|
||||||
[::AWS, ::Rackspace].each do |service|
|
[::AWS, ::Rackspace, ::Slicehost].each do |service|
|
||||||
if service.ready?
|
if service.ready?
|
||||||
services << service
|
services << service
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue