Module: VagrantPlugins::Deltacloud::Command::Utils

Included in:
Action::ReadSSHInfo, Action::WaitForServerToBeAccessible, HardwareProfileList, ImageList, InstanceList, NetworkList, Reset, VolumeList
Defined in:
lib/vagrant-deltacloud-provider/command/utils.rb

Instance Method Summary collapse

Instance Method Details

#display_item_list(env, items) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/vagrant-deltacloud-provider/command/utils.rb', line 7

def display_item_list(env, items)
  rows = []
  items.each do |item|
    rows << [item.id, item.name]
  end
  display_table(env, %w(Id Name), rows)
end

#display_table(env, headers, rows) ⇒ Object



15
16
17
18
# File 'lib/vagrant-deltacloud-provider/command/utils.rb', line 15

def display_table(env, headers, rows)
  table = Terminal::Table.new headings: headers, rows: rows
  env[:ui].info("\n#{table}")
end

#get_ip_address(env) ⇒ Object



20
21
22
23
# File 'lib/vagrant-deltacloud-provider/command/utils.rb', line 20

def get_ip_address(env)
  details = env[:deltacloud_client].get_instance_details(env, env[:machine].id)
  details.ip_address
end