Allow upload_from_string to use content-encoding
authorStavros Sachtouris <saxtouri@admin.grnet.gr>
Thu, 1 Aug 2013 10:37:01 +0000 (13:37 +0300)
committerStavros Sachtouris <saxtouri@admin.grnet.gr>
Thu, 1 Aug 2013 10:37:01 +0000 (13:37 +0300)
kamaki/clients/pithos/__init__.py
kamaki/clients/pithos/test.py

index 499a2c6..3dd380f 100644 (file)
@@ -445,7 +445,7 @@ class PithosClient(PithosRestClient):
                 try:
                     details = ['%s' % thread.exception for thread in missing]
                 except Exception:
-                    details = []
+                    details = ['Also, failed to read thread exceptions']
                 raise ClientError(
                     '%s blocks failed to upload' % len(missing),
                     details=details)
@@ -596,6 +596,7 @@ class PithosClient(PithosRestClient):
             format='json',
             hashmap=True,
             content_type=content_type,
+            content_encoding=content_encoding,
             if_etag_match=if_etag_match,
             if_etag_not_match='*' if if_not_exist else None,
             etag=etag,
index e155ef4..2e9d1d2 100644 (file)
@@ -1028,7 +1028,8 @@ class PithosClient(TestCase):
         tmpFile.seek(0)
         ctype = 'video/mpeg'
         sharing = dict(read=['u1', 'g1', 'u2'], write=['u1'])
-        r = self.client.upload_object(obj, tmpFile,
+        r = self.client.upload_object(
+            obj, tmpFile,
             content_type=ctype, sharing=sharing)
         self.assert_dicts_are_equal(r, exp_headers)
         self.assertEqual(OP.mock_calls[-1][2]['content_type'], ctype)