lib/yun/yun.rb in yun-0.0.1 vs lib/yun/yun.rb in yun-0.0.2
- old
+ new
@@ -1,13 +1,19 @@
require 'fog'
require 'hirb'
+require 'yun/config'
module Yun
class Yun
def self.list
- nodes = Fog::Compute.new({:provider => "aws",
- :region => "us-west-1"}).servers.map do |node|
+ config = Config.new
+ options = {:provider => "aws",
+ :aws_access_key_id => config.aws_access_key_id,
+ :aws_secret_access_key => config.aws_secret_access_key,
+ :region => config.region}
+
+ nodes = Fog::Compute.new(options).servers.map do |node|
{
:id => node.id,
:flavor_id => node.flavor_id,
:image_id => node.image_id,
:address => node.private_ip_address,