Added more debugging (some duplicate, but that's fine)
This commit is contained in:
parent
15e569d0bd
commit
4ea7feb04e
|
|
@ -217,7 +217,7 @@ 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:
|
for partition in self.partitions:
|
||||||
if partition.uuid == uuid:
|
if partition.uuid == uuid:
|
||||||
return partition
|
return partition
|
||||||
else:
|
else:
|
||||||
|
|
@ -226,4 +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"UUID parts: {partition.uuid for partition in self.partitions}")
|
||||||
|
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}")
|
||||||
|
|
|
||||||
|
|
@ -165,13 +165,16 @@ class Filesystem:
|
||||||
new_uuid_set = (previous_partition_uuids ^ {partition.uuid for partition in self.blockdevice.partitions.values()})
|
new_uuid_set = (previous_partition_uuids ^ {partition.uuid for partition in self.blockdevice.partitions.values()})
|
||||||
if len(new_uuid_set) > 0:
|
if len(new_uuid_set) > 0:
|
||||||
new_uuid = new_uuid_set.pop()
|
new_uuid = new_uuid_set.pop()
|
||||||
|
if new_uuid:
|
||||||
|
try:
|
||||||
|
return self.blockdevice.get_partition(new_uuid)
|
||||||
|
except Exception as err:
|
||||||
print('Blockdevice:', self.blockdevice)
|
print('Blockdevice:', self.blockdevice)
|
||||||
print('Partitions:', self.blockdevice.partitions)
|
print('Partitions:', self.blockdevice.partitions)
|
||||||
print('Partition set:', new_uuid_set)
|
print('Partition set:', new_uuid_set)
|
||||||
print('New UUID:', [new_uuid])
|
print('New UUID:', [new_uuid])
|
||||||
print('get_partition():', self.blockdevice.get_partition)
|
print('get_partition():', self.blockdevice.get_partition)
|
||||||
if new_uuid:
|
raise err
|
||||||
return self.blockdevice.get_partition(new_uuid)
|
|
||||||
else:
|
else:
|
||||||
count += 1
|
count += 1
|
||||||
log(f"Could not get uuid for partition. Waiting for the {count} time",level=logging.DEBUG)
|
log(f"Could not get uuid for partition. Waiting for the {count} time",level=logging.DEBUG)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue