5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/mccloud/provider/vmfusion/provider/status.rb', line 5
def status(selection=nil,options=nil)
env.ui.info ""
80.times { |i| printf "*"}; env.ui.info ""
all_vms = ::Fission::VM.all
all_running_vms = ::Fission::VM.all_running
longest_vm_name = all_vms.max { |a,b| a.length <=> b.length }
::Fission::VM.all.each do |vm|
status = all_running_vms.include?(vm) ? '[running]' : '[not running]'
Fission.ui.output_printf "%-#{longest_vm_name.length}s %s\n", vm, status
end
end
|