Class: Chef::Knife::EucaFlavorList

Inherits:
Chef::Knife show all
Includes:
EucaBase
Defined in:
lib/chef/knife/euca_flavor_list.rb

Instance Method Summary collapse

Methods included from EucaBase

#connection, included, #locate_config_value, #public_ip

Instance Method Details

#runObject


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/chef/knife/euca_flavor_list.rb', line 29

def run
  flavor_list = [
    ui.color('ID', :bold),
    ui.color('Architecture', :bold),
    ui.color('RAM', :bold),
    ui.color('Disk', :bold),
    ui.color('Cores', :bold)
  ]
  connection.flavors.sort_by(&:id).each do |flavor|
    flavor_list << flavor.id.to_s
    flavor_list << "#{flavor.bits.to_s}-bit"
    flavor_list << "#{flavor.ram.to_s} MB"
    flavor_list << "#{flavor.disk.to_s} GB"
    flavor_list << flavor.cores.to_s
  end
  puts ui.list(flavor_list, :columns_across, 5)
end