Permalink
Browse files

Items in the image list may be nil

  • Loading branch information...
1 parent 685c9c6 commit 526adcb8f156147f356dce703a3c58ae5d84a5e1 @drbrain drbrain committed Apr 7, 2011
Showing with 12 additions and 4 deletions.
  1. +12 −4 lib/chef/knife/openstack_image_list.rb
@@ -68,14 +68,22 @@ def run
ui.color('Name', :bold),
ui.color('Location', :bold)
]
- connection.images.sort_by(&:name).each do |image|
- image_list << image.id.to_s
- image_list << image.kernel_id.to_s
- image_list << image.architecture.to_s
+
+ connection.images.sort_by do |image|
+ [image.name, image.id].compact
+ end.each do |image|
+ image_list << image.id
+ image_list << image.kernel_id
+ image_list << image.architecture
image_list << image.root_device_type
image_list << image.name
image_list << image.location
end
+
+ image_list = image_list.map do |item|
+ item.to_s
+ end
+
puts ui.list(image_list, :columns_across, 6)
end
end

0 comments on commit 526adcb

Please sign in to comment.