def images(credentials, opts={} )
ec2 = new_client(credentials)
img_arr = []
if (opts and opts[:id])
config = { :image_id => opts[:id] }
else
config = { :owner_id => "amazon" }
config.merge!({ :owner_id => opts[:owner_id] }) if opts and opts[:owner_id]
end
safely do
image_set = ec2.describe_images(config).imagesSet
unless image_set.nil?
image_set.item.each do |image|
img_arr << convert_image(image)
end
end
end
img_arr = filter_on( img_arr, :architecture, opts )
img_arr.sort_by{|e| [e.owner_id, e.name]}
end