incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 1/2] Allow to show all EC2 images using owner_id=all
Date Tue, 08 Feb 2011 10:06:08 GMT
From: Michal Fojtik <mfojtik@redhat.com>

---
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index fd3f9d9..497d9ef 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -135,10 +135,12 @@ module Deltacloud
             end
             return img_arr
           end
-          owner_id = opts[:owner_id] || "amazon"
+          owner_id = opts[:owner_id] || 'amazon'
           safely do
-            img_arr = ec2.describe_images_by_owner(owner_id, "machine").collect do |image|
-              convert_image(image)
+            if owner_id.eql?('all')
+              img_arr = ec2.describe_images_by_executable_by('all', 'machine').collect {
|image| convert_image(image) }
+            else
+              img_arr = ec2.describe_images_by_owner([owner_id], 'machine').collect { |image|
convert_image(image) }
             end
           end
           img_arr = filter_on( img_arr, :architecture, opts )
-- 
1.7.4


Mime
View raw message