Fix type passed to write function during backup restoration
Cinder backup throws a TypeError when trying to restore to a new volume,
because slicing a memoryview object does not return a byte string.
Closes-Bug: #2082587
Change-Id: Ibaf87af25dc33c59660be6e112ca78b993592385
(cherry picked from commit b5ac261e6a)
This commit is contained in:
committed by
Lana Kaleif
parent
32a71114c8
commit
5a1bb8ee84
@@ -78,7 +78,7 @@ def _write_nonzero(volume_file, volume_offset, content):
|
||||
# The len(chunk) may be smaller than chunk_length. It's okay.
|
||||
if not volume_utils.is_all_zero(chunk):
|
||||
volume_file.seek(volume_offset + chunk_offset)
|
||||
volume_file.write(chunk)
|
||||
volume_file.write(chunk.tobytes())
|
||||
|
||||
|
||||
def _write_volume(volume_is_new, volume_file, volume_offset, content):
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
`Bug #2082587 <https://bugs.launchpad.net/cinder/+bug/2082587>` _: Fixed
|
||||
backup restoration throwing TypeError on new volume.
|
||||
Reference in New Issue
Block a user