Fix upload of Swift object smaller than segment limit (create_object)

Opening file in text mode results in silently failing upload

Change-Id: I0aed6f7080076d44f0c75bf58628eb39406ed6ef
This commit is contained in:
Daniel Speichert 2018-10-20 22:17:34 -04:00
parent ec90fb6402
commit 5d7a44c3cc
1 changed files with 1 additions and 1 deletions

View File

@ -7784,7 +7784,7 @@ class _OpenStackCloudMixin(_normalize.Normalizer):
def _upload_object(self, endpoint, filename, headers):
return _adapter._json_response(self.object_store.put(
endpoint, headers=headers, data=open(filename, 'r')))
endpoint, headers=headers, data=open(filename, 'rb')))
def _get_file_segments(self, endpoint, filename, file_size, segment_size):
# Use an ordered dict here so that testing can replicate things