Skip to content

Commit

Permalink
Include container name in X-Object-Manifest header when creating DLO
Browse files Browse the repository at this point in the history
This is related to pycontribs#258, and fixes the following error when PUTting Dynamic Large Objects (multipart files):
    ClientException: Object PUT failed: https://storage101.dfw1.clouddrive.com:443/v1/MossoCloudFS_fab7bcd7-c313-4e3a-a55c-dea7ee252b1c/jordan-test/test 400 Bad Request   X-Object-Manifest must in the format container/prefix
  • Loading branch information
Francis Devereux committed Dec 10, 2013
1 parent 9553f94 commit b876828
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyrax/cf_wrapper/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ def upload(fileobj, content_type, etag, headers):
etag=etag, headers=headers,
response_dict=extra_info)
# Upload the manifest
headers["X-Object-Manifest"] = "%s." % obj_name
headers["X-Object-Manifest"] = "%s/%s." % (cont.name, obj_name)
return self.connection.put_object(cont.name, obj_name,
contents=None, headers=headers,
response_dict=extra_info)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_cf_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ def test_upload_large_file_from_file_object_with_obj_name(self):
self.assertEqual(put_calls[1][1][1], '%s.2' % obj_name)
self.assertEqual(put_calls[2][1][1], obj_name)
self.assertEqual(put_calls[2][2]["headers"]["X-Object-Manifest"],
obj_name + ".")
self.cont_name + "/" + obj_name + ".")

# get_object() should be called with the same name that was passed
# to the final put_object() call (to get the object to return)
Expand Down

0 comments on commit b876828

Please sign in to comment.