Open tarball in binary mode
Under python3 this open call fails in swiftclient because it tries to decode the data using utf-8. Since we're uploading a binary tarball anyway we should us binary i/o instead. Change-Id: I5b8aff53e44024e916b9a491e52ffd9362ca39e4 Closes-Bug: #1788288
This commit is contained in:
@@ -35,7 +35,7 @@ def create_tarball(directory, filename, options='-czf',
|
|||||||
def tarball_extract_to_swift_container(object_client, filename, container):
|
def tarball_extract_to_swift_container(object_client, filename, container):
|
||||||
LOG.debug('Uploading filename %s to Swift container %s' % (filename,
|
LOG.debug('Uploading filename %s to Swift container %s' % (filename,
|
||||||
container))
|
container))
|
||||||
with open(filename, 'r') as f:
|
with open(filename, 'rb') as f:
|
||||||
object_client.put_object(
|
object_client.put_object(
|
||||||
container=container,
|
container=container,
|
||||||
obj='',
|
obj='',
|
||||||
|
Reference in New Issue
Block a user