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/05/09 21:51:33 UTC

svn commit: r1101173 - in /incubator/libcloud/trunk: libcloud/storage/drivers/cloudfiles.py test/storage/test_cloudfiles.py

Author: tomaz
Date: Mon May  9 19:51:33 2011
New Revision: 1101173

URL: http://svn.apache.org/viewvc?rev=1101173&view=rev
Log:
Throw an exception if an unexpected status code is returned.

Modified:
    incubator/libcloud/trunk/libcloud/storage/drivers/cloudfiles.py
    incubator/libcloud/trunk/test/storage/test_cloudfiles.py

Modified: incubator/libcloud/trunk/libcloud/storage/drivers/cloudfiles.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/storage/drivers/cloudfiles.py?rev=1101173&r1=1101172&r2=1101173&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/storage/drivers/cloudfiles.py (original)
+++ incubator/libcloud/trunk/libcloud/storage/drivers/cloudfiles.py Mon May  9 19:51:33 2011
@@ -360,6 +360,10 @@ class CloudFilesStorageDriver(StorageDri
                 driver=self)
 
             return obj
+        else:
+            # @TODO: Add test case for this condition (probably 411)
+            raise LibcloudError('status_code=%s' % (response.status),
+                                driver=self)
 
     def _clean_container_name(self, name):
         """

Modified: incubator/libcloud/trunk/test/storage/test_cloudfiles.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/storage/test_cloudfiles.py?rev=1101173&r1=1101172&r2=1101173&view=diff
==============================================================================
--- incubator/libcloud/trunk/test/storage/test_cloudfiles.py (original)
+++ incubator/libcloud/trunk/test/storage/test_cloudfiles.py Mon May  9 19:51:33 2011
@@ -642,7 +642,7 @@ class CloudFilesMockRawResponse(MockRawR
 
         # test_upload_object_via_stream_success
         body = 'test'
-        return (httplib.OK,
+        return (httplib.CREATED,
                 body,
                 self.base_headers,
                 httplib.responses[httplib.OK])