Skip to content

Commit ba8a316

Browse files
committed
fix vdi type info
1 parent a41b393 commit ba8a316

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/cleanup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3405,7 +3405,7 @@ def scan(self, force=False) -> None:
34053405
vdi = self.getVDI(uuid)
34063406
if not vdi:
34073407
self.logFilter.logNewVDI(uuid)
3408-
vdi = LinstorVDI(self, uuid, vdiInfo.vdiType)
3408+
vdi = LinstorVDI(self, uuid, vdiInfo.vdiType if vdiInfo else VdiType.RAW)
34093409
self.vdis[uuid] = vdi
34103410
if vdiInfo:
34113411
vdi.load(vdiInfo)
@@ -3477,6 +3477,7 @@ def _load_vdi_info(self):
34773477
all_volume_info = self._linstor.get_volumes_with_info()
34783478
volumes_metadata = self._linstor.get_volumes_with_metadata()
34793479
for vdi_uuid, volume_info in all_volume_info.items():
3480+
vdi_type = VdiType.RAW
34803481
try:
34813482
volume_metadata = volumes_metadata[vdi_uuid]
34823483
if not volume_info.name and not list(volume_metadata.items()):
@@ -3531,6 +3532,9 @@ def _load_vdi_info(self):
35313532
info = CowImageInfo(vdi_uuid)
35323533
info.error = 1
35333534

3535+
if info:
3536+
info.vdiType = vdi_type
3537+
35343538
all_vdi_info[vdi_uuid] = info
35353539

35363540
return all_vdi_info

0 commit comments

Comments
 (0)