Class: KnifeLxc::LxcServerList
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- KnifeLxc::LxcServerList
- Defined in:
- lib/chef/knife/lxc_server_list.rb
Instance Method Summary collapse
-
#run ⇒ Object
This method will be executed when you run this knife command.
Instance Method Details
#run ⇒ Object
This method will be executed when you run this knife command.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/chef/knife/lxc_server_list.rb', line 12 def run puts "Lxc containers list" containers = `lxc-ls`.split.uniq server_list = [ ui.color('Name', :bold), ui.color('Ip', :bold) ] containers.each do |container| server_list << container server_list << get_ip(container) end puts ui.list(server_list, :uneven_columns_across, 2) end |