Class: Chef::Knife::XenserverHostList

Inherits:
Chef::Knife show all
Includes:
XenserverBase
Defined in:
lib/chef/knife/xenserver_host_list.rb

Instance Method Summary collapse

Methods included from XenserverBase

#bytes_to_megabytes, #connection, included, #locate_config_value

Instance Method Details

#runObject



28
29
30
31
32
33
34
35
36
37
# File 'lib/chef/knife/xenserver_host_list.rb', line 28

def run
  hosts = connection.hosts
  table = table do |t|
    t.headings = %w{NAME UUID}
    hosts.each do |host|
      t << [host.name, host.uuid]
    end
  end
  puts table if !hosts.empty?
end