lib/cloudstack-cli/commands/physical_network.rb in cloudstack-cli-0.1.2 vs lib/cloudstack-cli/commands/physical_network.rb in cloudstack-cli-0.1.3
- old
+ new
@@ -3,19 +3,20 @@
desc "list", "list physical networks"
option :project
def list
project = find_project if options[:project]
networks = client.list_physical_networks
+ zones = client.list_zones
if networks.size < 1
puts "No networks found"
else
- table = [['Name', 'State', 'ID', 'Zone ID']]
+ table = [['Name', 'State', 'Zone', 'ID']]
networks.each do |network|
table << [
network["name"],
network["state"],
- network["id"],
- network["zoneid"]
+ zones.select{|zone| zone['id'] == network["zoneid"]}.first["name"],
+ network["id"]
]
end
print_table table
end
end
\ No newline at end of file