Class: Chef::Knife::VcOrgList

Inherits:
Chef::Knife show all
Includes:
VcCommon
Defined in:
lib/chef/knife/org/vc_org_list.rb

Instance Method Summary collapse

Methods included from VcCommon

#connection, #deprecation_msg, #generate_key, #get_password, included, #locate_config_value, #locate_org_option, #notice_msg, #out_msg, #pretty_symbol, #sort_by_key, #store_config, #store_password, #wait_task

Instance Method Details

#runObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/chef/knife/org/vc_org_list.rb', line 26

def run
  $stdout.sync = true

  list = [
      ui.color('Name', :bold),
      ui.color('ID', :bold)
  ]

  connection.
  org_list = connection.get_organizations
  connection.logout

  org_list.each do |k, v|
    list << (k || '')
    list << (v || '')
  end
  ui.msg ui.list(list, :columns_across, 2)
end