1
0
Fork 0
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:
geemus (Wesley Beary) 2010-02-06 15:43:02 -08:00
parent 7cafd6d2c1
commit ca532db0be

45
bin/fog
View file

@ -127,12 +127,55 @@ module Rackspace
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
class << self
def services
services = []
[::AWS, ::Rackspace].each do |service|
[::AWS, ::Rackspace, ::Slicehost].each do |service|
if service.ready?
services << service
end