deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject git commit: Fixes DTACLOUD_174: GET on non-existant blob should return 404 (ec2 driver was giving 200OK)
Date Thu, 29 Mar 2012 13:06:57 GMT
Updated Branches:
  refs/heads/master 8e01f0625 -> a16c34de0


Fixes DTACLOUD_174: GET on non-existant blob should return 404 (ec2 driver was giving 200OK)

https://issues.apache.org/jira/browse/DTACLOUD-174


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/a16c34de
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/a16c34de
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/a16c34de

Branch: refs/heads/master
Commit: a16c34de06776f91fb68cc49e6e1f7d2c815fc01
Parents: 8e01f06
Author: marios <marios@redhat.com>
Authored: Mon Mar 26 15:07:25 2012 +0300
Committer: marios <marios@redhat.com>
Committed: Thu Mar 29 16:06:25 2012 +0300

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


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a16c34de/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 9de0a54..7b1cc8c 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -412,7 +412,9 @@ module Deltacloud
           safely do
             s3_bucket = s3_client.bucket(opts['bucket'])
             if(opts[:id])
-              blobs << convert_object(s3_bucket.key(opts[:id], true))
+              s3_key = s3_bucket.key(opts[:id], true)
+              raise "Blob #{opts[:id]} in Bucket #{opts['bucket']} NotFound" unless s3_key.exists?
+              blobs << convert_object(s3_key)
             else
               s3_bucket.keys({}, true).each do |s3_object|
                 blobs << convert_object(s3_object)
@@ -468,6 +470,7 @@ module Deltacloud
           blob_meta = {}
           safely do
             the_blob = s3_client.bucket(opts['bucket']).key(opts[:id], true)
+            raise "Blob #{opts[:id]} in Bucket #{opts['bucket']} NotFound" unless the_blob.exists?
             blob_meta = the_blob.meta_headers
           end
         end


Mime
View raw message