summaryrefslogtreecommitdiffstats
path: root/src/ceph-volume
diff options
context:
space:
mode:
authorGuillaume Abrioux <gabrioux@ibm.com>2024-10-09 17:00:53 +0200
committerGuillaume Abrioux <gabrioux@ibm.com>2024-10-16 15:42:10 +0200
commitb5e7008d28a5acd63ea9cd0c6b27f400dad409af (patch)
treef50d3f87e59eeb25f517a32df596b448199c7547 /src/ceph-volume
parentceph-volume: address test_activate_dmcrypt_tpm (diff)
downloadceph-b5e7008d28a5acd63ea9cd0c6b27f400dad409af.tar.xz
ceph-b5e7008d28a5acd63ea9cd0c6b27f400dad409af.zip
ceph-volume: address mypy errors in disk.py
typical error: ``` ceph_volume/util/disk.py:1374: error: Incompatible types in assignment (expression has type "Optional[str]", variable has type "str") [assignment] ``` This commits addresses it. Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
Diffstat (limited to 'src/ceph-volume')
-rw-r--r--src/ceph-volume/ceph_volume/util/disk.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ceph-volume/ceph_volume/util/disk.py b/src/ceph-volume/ceph_volume/util/disk.py
index 78c140597d6..3ac51c11e34 100644
--- a/src/ceph-volume/ceph_volume/util/disk.py
+++ b/src/ceph-volume/ceph_volume/util/disk.py
@@ -1370,8 +1370,8 @@ class UdevData:
"""
result: str = self.path
if self.is_lvm:
- vg: str = self.environment.get('DM_VG_NAME')
- lv: str = self.environment.get('DM_LV_NAME')
+ vg: str = self.environment.get('DM_VG_NAME', '')
+ lv: str = self.environment.get('DM_LV_NAME', '')
result = f'/dev/{vg}/{lv}'
return result
@@ -1385,6 +1385,6 @@ class UdevData:
"""
result: str = self.path
if self.is_lvm:
- name: str = self.environment.get('DM_NAME')
+ name: str = self.environment.get('DM_NAME', '')
result = f'/dev/mapper/{name}'
return result