Skip to content

Commit

Permalink
(#177): backup with compression enabled fails: unsupported operand ty…
Browse files Browse the repository at this point in the history
…pe(s)
  • Loading branch information
abbbi committed Apr 24, 2024
1 parent e6e48c9 commit 45c2677
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 2.9
---------
* Fix: backup with compression enabled fails: unsupported operand type(s) for
+: 'int' and 'dict' (#177)


Version 2.8
---------
* Add packages compatible to fedora 39 to package build (#174)
Expand Down
6 changes: 2 additions & 4 deletions libvirtnbdbackup/backup/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def backup( # pylint: disable=too-many-arguments,too-many-branches, too-many-lo
writer.write(sTypes.TERM)
if args.compress:
logging.debug("Compressed size: %s", size)
backupSize += size
if cSizes:
blockList = {}
blockList[size] = cSizes
Expand All @@ -184,7 +185,7 @@ def backup( # pylint: disable=too-many-arguments,too-many-branches, too-many-lo
compressedSizes.append(size)
else:
assert size == save.length
backupSize += save.length
backupSize += save.length
else:
if streamType == "raw":
writer.seek(save.offset)
Expand Down Expand Up @@ -215,7 +216,4 @@ def backup( # pylint: disable=too-many-arguments,too-many-branches, too-many-lo
partialfile.rename(targetFilePartial, targetFile)
backupChecksum(fileStream, targetFile)

if args.compress:
backupSize = sum(blen for blen in compressedSizes)

return backupSize, True

0 comments on commit 45c2677

Please sign in to comment.