]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: set default value for BlueStore.block_lv to None
authorGuillaume Abrioux <gabrioux@ibm.com>
Wed, 8 Jan 2025 12:45:34 +0000 (12:45 +0000)
committerGuillaume Abrioux <gabrioux@ibm.com>
Mon, 24 Feb 2025 11:53:10 +0000 (11:53 +0000)
This change updates the `BlueStore` class in
`ceph_volume.objectstore` by initializing the `block_lv` attribute
to `None` with the type `Optional[Volume]`. This ensures that the
attribute has a default value and avoids potential runtime errors
when the attribute is accessed before being explicitly assigned.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit 4b0c3bbed377e1ee5ae7e4a765741f9a877935ef)

src/ceph-volume/ceph_volume/objectstore/bluestore.py

index ceaa199a18b7f3e08c1f7185dcfc96f2c48cf465..535551b516d436ee1e08a5b1aaf0bb9ca237d602 100644 (file)
@@ -25,7 +25,7 @@ class BlueStore(BaseObjectStore):
         self.block_device_path: str = ''
         self.wal_device_path: str = ''
         self.db_device_path: str = ''
-        self.block_lv: Volume
+        self.block_lv: Optional[Volume] = None
 
     def add_objectstore_opts(self) -> None:
         """