incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@redhat.com
Subject [PATCH 2/4] Minor edit in 'blobs' method to utilise :id if present
Date Wed, 08 Jun 2011 17:09:33 GMT
From: marios <marios@redhat.com>


Signed-off-by: marios <marios@redhat.com>
---
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index d37e8ab..3f6514c 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -387,8 +387,12 @@ module Deltacloud
           blobs = []
           safely do
             s3_bucket = s3_client.bucket(opts['bucket'])
-            s3_bucket.keys({}, true).each do |s3_object|
-              blobs << convert_object(s3_object)
+            if(opts[:id])
+              blobs << convert_object(s3_bucket.key(opts[:id], true))
+            else
+              s3_bucket.keys({}, true).each do |s3_object|
+                blobs << convert_object(s3_object)
+              end
             end
           end
           blobs = filter_on(blobs, :id, opts)
-- 
1.7.3.4


Mime
View raw message