lib/poolparty/net/remoter_bases/ec2/ec2.rb
# TODO: Clean up this method and remove hostnames
Clean up this method and remove hostnames
Clean up this method and remove hostnames
def describe_instances(o={})
        id = 0
        get_instances_description(options.merge(o)).each_with_index do |h,i|          
          if h[:status] == "running"
            inst_name = id == 0 ? "master" : "node#{id}"
            id += 1
          else
            inst_name = "#{h[:status]}_node#{i}"
          end
          h.merge!({
            :name => inst_name,
            :hostname => h[:ip],
            :ip => h[:ip].convert_from_ec2_to_ip,
            :index => i,  
            :launching_time => (h[:launching_time])
          })
        end.compact.sort {|a,b| a[:index] <=> b[:index] }
      end
def describe_instances ( o = { } ) id = 0 get_instances_description ( options . merge ( o ) ) . each_with_index do | h , i | if h [ :status ] == "running" inst_name = id == 0 ? "master" : "node#{id}" id += 1 else inst_name = "#{h[:status]}_node#{i}" end h . merge! ( { :name => inst_name , :hostname => h [ :ip ] , :ip => h [ :ip ] . convert_from_ec2_to_ip , :index => i , :launching_time => ( h [ :launching_time ] ) } ) end . compact . sort { | a , b | a [ :index ] <=> b [ :index ] } end
TODO: Clean up this method and remove hostnames
TODO : Clean up this method and remove hostnames
#TODO MF get the instance id from the aws result instead
o