You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2011/04/10 19:50:19 UTC

svn commit: r1090852 - /incubator/libcloud/trunk/libcloud/storage/drivers/s3.py

Author: tomaz
Date: Sun Apr 10 17:50:18 2011
New Revision: 1090852

URL: http://svn.apache.org/viewvc?rev=1090852&view=rev
Log:
Properly handle response when the invalid hash is provided.

Modified:
    incubator/libcloud/trunk/libcloud/storage/drivers/s3.py

Modified: incubator/libcloud/trunk/libcloud/storage/drivers/s3.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/storage/drivers/s3.py?rev=1090852&r1=1090851&r2=1090852&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/storage/drivers/s3.py (original)
+++ incubator/libcloud/trunk/libcloud/storage/drivers/s3.py Sun Apr 10 17:50:18 2011
@@ -352,7 +352,8 @@ class S3StorageDriver(StorageDriver):
         headers = response.headers
         response = response.response
 
-        if file_hash and file_hash != headers['etag'].replace('"', ''):
+        if (file_hash and response.status == httplib.BAD_REQUEST) or \
+           (file_hash and file_hash != headers['etag'].replace('"', '')):
             raise ObjectHashMismatchError(
                 value='MD5 hash checksum does not match',
                 object_name=object_name, driver=self)