Permalink
Browse files

Zone list complete

  • Loading branch information...
1 parent 33b1e20 commit 905c0f895523837d70c9e439cd147fa633baa96b @fifthecho committed Mar 11, 2012
Showing with 12 additions and 7 deletions.
  1. +12 −7 lib/chef/knife/cloudstack_zone_list.rb
@@ -34,19 +34,24 @@ def run
zone_list = [
ui.color('ID', :bold),
ui.color('Name', :bold),
- ui.color('Description', :bold),
- ui.color('Disk Size (in GB)', :bold)
+ ui.color('Network Type', :bold),
+ ui.color('Security Groups?', :bold)
]
response = connection.list_zones['listzonesresponse']
- puts response
if zones = response['zone']
zones.each do |zone|
zone_list << zone['id'].to_s
zone_list << zone['name'].to_s
- zone_list << zone['displaytext'].to_s
- disk_size = zone['disksize']
- zone_list << disk_size.to_s
-
+ zone_list << zone['networktype'].to_s
+ zone_list << begin
+ state = zone['securitygroupsenabled'].to_s.downcase
+ case state
+ when 'false'
+ ui.color('No', :red)
+ else
+ ui.color('Yes', :green)
+ end
+ end
end
end
puts ui.list(zone_list, :columns_across, 4)

0 comments on commit 905c0f8

Please sign in to comment.