Tweaked partitions usage in blockdevice
This commit is contained in:
parent
4ea7feb04e
commit
c2bfc4e340
|
|
@ -217,8 +217,8 @@ class BlockDevice:
|
||||||
def get_partition(self, uuid):
|
def get_partition(self, uuid):
|
||||||
count = 0
|
count = 0
|
||||||
while count < 5:
|
while count < 5:
|
||||||
for partition in self.partitions:
|
for partition_uuid, partition in self.partitions.items():
|
||||||
if partition.uuid == uuid:
|
if partition_uuid == uuid:
|
||||||
return partition
|
return partition
|
||||||
else:
|
else:
|
||||||
log(f"uuid {uuid} not found. Waiting for {count +1} time",level=logging.DEBUG)
|
log(f"uuid {uuid} not found. Waiting for {count +1} time",level=logging.DEBUG)
|
||||||
|
|
@ -226,7 +226,7 @@ class BlockDevice:
|
||||||
count += 1
|
count += 1
|
||||||
else:
|
else:
|
||||||
log(f"Could not find {uuid} in disk after 5 retries",level=logging.INFO)
|
log(f"Could not find {uuid} in disk after 5 retries",level=logging.INFO)
|
||||||
print(f"Partitions: {self.partitions}")
|
print(f"Cache: {self.part_cache}")
|
||||||
print(f"UUID parts: {partition.uuid for partition in self.partitions}")
|
print(f"Partitions: {self.partitions.items()}")
|
||||||
print(f"UUID: {[uuid]}")
|
print(f"UUID: {[uuid]}")
|
||||||
raise DiskError(f"New partition {uuid} never showed up after adding new partition on {self}")
|
raise DiskError(f"New partition {uuid} never showed up after adding new partition on {self}")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue