From: Itamar Turner-Trauring <itamar@futurefoundries.com>
Date: Thu, 21 Mar 2013 18:40:27 +0000 (-0400)
Subject: Fix PUTs.
X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/provisioning?a=commitdiff_plain;h=72aabca8a0bbfb76a98938d22838215e22aa6e6b;p=tahoe-lafs%2Ftahoe-lafs.git

Fix PUTs.
---

diff --git a/src/allmydata/storage/backends/cloud/msazure/msazure_container.py b/src/allmydata/storage/backends/cloud/msazure/msazure_container.py
index f99b0510..2cf09637 100644
--- a/src/allmydata/storage/backends/cloud/msazure/msazure_container.py
+++ b/src/allmydata/storage/backends/cloud/msazure/msazure_container.py
@@ -178,6 +178,7 @@ class MSAzureStorageContainer(CommonContainerMixin):
         # correctly:
         request_headers = {'Content-Length': ["%d" % (len(data),)],
                            'Content-Type': [content_type],
+                           "x-ms-blob-type": ["BlockBlob"],
                            }
         for key, value in metadata.items():
             request_headers["x-ms-meta-%s" % (key,)] = [value]
@@ -232,18 +233,18 @@ if __name__ == '__main__':
     @defer.inlineCallbacks
     def testtransactions():
         yield msc.put_object("key", "the value")
-        print "Uploaded key:'the value'"
+        print "Uploaded 'key', with value 'the value'"
         print
-        print "Get contents:"
+        print "Get contents:",
         result = yield msc.list_objects()
         print [item.key for item in result.contents]
         print "Get key, value is:"
         print (yield msc.get_object("key"))
         print
-        print "Delete item:"
+        print "Delete item..."
         yield msc.delete_object("key")
         print
-        print "Get contents:"
+        print "Get contents:", 
         result = yield msc.list_objects()
         print [item.key for item in result.contents]
         reactor.stop()
diff --git a/src/allmydata/test/test_storage.py b/src/allmydata/test/test_storage.py
index ef4ad1db..cbeef872 100644
--- a/src/allmydata/test/test_storage.py
+++ b/src/allmydata/test/test_storage.py
@@ -1332,6 +1332,7 @@ class MSAzureStorageBackendTests(unittest.TestCase, CloudStorageBackendMixin):
              "Content-Type": ["application/octet-stream"],
              "Content-Length": [str(len("the body"))],
              "x-ms-date": [self.date],
+             "x-ms-blob-type": ["BlockBlob"],
              },
             body="the body",
             need_response_body=False)
@@ -1361,6 +1362,7 @@ class MSAzureStorageBackendTests(unittest.TestCase, CloudStorageBackendMixin):
              "Content-Length": [str(len("the body"))],
              "x-ms-meta-key": ["value"],
              "x-ms-date": [self.date],
+             "x-ms-blob-type": ["BlockBlob"],
              },
             body="the body",
             need_response_body=False)