summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-04-12 16:48:53 +0000
committerGerrit Code Review <review@openstack.org>2023-04-12 16:48:53 +0000
commit78fac2960d28e97f42454bb5f385b46fbae23a3c (patch)
treecb3ea7932d659fe8526ac6be50222d6cf057432f
parentc8305f44d2204918a6d7d30c884d2e033b02b5bb (diff)
parent63b6e569602a05801b0706a646f753af9b2bf0da (diff)
downloadcinder-78fac2960d28e97f42454bb5f385b46fbae23a3c.tar.gz
Merge "Shut up pylint about win32_disk_size"
-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: