]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Actually run the creation code against real Azure service, and corresponding bug...
authorItamar Turner-Trauring <itamar@futurefoundries.com>
Thu, 16 May 2013 17:53:35 +0000 (13:53 -0400)
committerDaira Hopwood <daira@jacaranda.org>
Fri, 16 Oct 2015 16:53:02 +0000 (17:53 +0100)
src/allmydata/storage/backends/cloud/msazure/msazure_container.py
src/allmydata/test/test_storage.py

index 11303d056890f094211e3d1167c0b0a976ad0c52..c2936b04ee3aab5ca2590174bc64028fd4c3bc6d 100644 (file)
@@ -221,7 +221,8 @@ class MSAzureStorageContainer(CommonContainerMixin):
         url = self._make_container_url(self.URI)
         url += "?restype=container"
         d = self._authorized_http_request("MS Azure PUT container", 'PUT',
-                                          url, {}, body=None,
+                                          url, {'Content-length': ['0']},
+                                          body=None,
                                           need_response_body=False)
         d.addCallback(lambda (response, body): body)
         return d
@@ -245,6 +246,13 @@ if __name__ == '__main__':
 
     @defer.inlineCallbacks
     def testtransactions():
+        print "Creating container...",
+        try:
+            yield msc.create()
+        except Exception, e:
+            print "failed:", e
+        else:
+            print "succeeded."
         yield msc.put_object("key", "the value")
         print "Uploaded 'key', with value 'the value'"
         print
index baab93878e715d6e687ffa3a7b923b95403d7e36..951b5bbc413510578bf5c70a14b79464b19156af 100644 (file)
@@ -1529,6 +1529,9 @@ class MSAzureStorageBackendTests(unittest.TestCase, CloudStorageBackendMixin):
             "MS Azure PUT container", "PUT",
             "https://theaccount.blob.core.windows.net/thebucket?restype=container",
             {"Authorization": [self.authorization],
+             # This is not documented as required, but is apparently necessary
+             # nonetheless:
+             'Content-length': ['0'],
              "x-ms-version": ["2012-02-12"],
              "x-ms-date": [self.date],
              },