summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Zaitcev <zaitcev@kotori.zaitcev.us>2023-03-29 10:13:06 -0500
committerPete Zaitcev <zaitcev@kotori.zaitcev.us>2023-04-11 13:02:26 -0500
commit63b6e569602a05801b0706a646f753af9b2bf0da (patch)
tree998e2bf48e3f536a41dcce38ba26aad992bd7fde
parentdfef52f3a6e6ba6fde0e985621673064c8c86356 (diff)
downloadcinder-63b6e569602a05801b0706a646f753af9b2bf0da.tar.gz
Shut up pylint about win32_disk_size
The pylint job is non-voting, but it was annoying to see it fail. To add the insult to injury, the code was correct, but the pylint was not smart enough. So this patch only exists to address shortcomings of our toolchain. Change-Id: I391e03426c42b7af122722cd851c4aa03f2dcb68
-rw-r--r--cinder/backup/chunkeddriver.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cinder/backup/chunkeddriver.py b/cinder/backup/chunkeddriver.py
index 6d28fc399..b5dcf5d45 100644
--- a/cinder/backup/chunkeddriver.py
+++ b/cinder/backup/chunkeddriver.py
@@ -555,6 +555,7 @@ class ChunkedBackupDriver(driver.BackupDriver, metaclass=abc.ABCMeta):
'backup. Do a full backup.')
raise exception.InvalidBackup(reason=err)
+ win32_disk_size = None
if sys.platform == 'win32':
# When dealing with Windows physical disks, we need the exact
# size of the disk. Attempting to read passed this boundary will
@@ -602,7 +603,7 @@ class ChunkedBackupDriver(driver.BackupDriver, metaclass=abc.ABCMeta):
break
data_offset = volume_file.tell()
- if sys.platform == 'win32':
+ if win32_disk_size is not None:
read_bytes = min(self.chunk_size_bytes,
win32_disk_size - data_offset)
else: