2010-07-03 11:48:13 -04:00
|
|
|
module Linode
|
|
|
|
class << self
|
|
|
|
if Fog.credentials[:linode_api_key]
|
|
|
|
|
|
|
|
def initialized?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def [](service)
|
|
|
|
@@connections ||= Hash.new do |hash, key|
|
|
|
|
hash[key] = case key
|
2010-09-08 13:56:38 -04:00
|
|
|
when :compute
|
|
|
|
Fog::Linode::Compute.new
|
2010-09-08 17:00:43 -04:00
|
|
|
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
|
2010-07-03 11:48:13 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
@@connections[service]
|
|
|
|
end
|
|
|
|
|
2010-09-03 18:32:30 -04:00
|
|
|
def services
|
2010-09-08 13:56:38 -04:00
|
|
|
[:compute]
|
2010-09-03 18:32:30 -04:00
|
|
|
end
|
|
|
|
|
2010-07-03 11:48:13 -04:00
|
|
|
else
|
|
|
|
|
|
|
|
def initialized?
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|