Fixed an issue where Partition() instances got overwritten every time disk.partitions were called. Causing flags such as .encrypted to be dropped. This should make for a more stable experience when working with the partitions.
This commit is contained in:
parent
7ee4815648
commit
16b0f4a4a4
|
|
@ -106,7 +106,8 @@ class BlockDevice():
|
|||
part_id = part['name'][len(os.path.basename(self.path)):]
|
||||
if part_id not in self.part_cache:
|
||||
## TODO: Force over-write even if in cache?
|
||||
self.part_cache[part_id] = Partition(root_path + part_id, part_id=part_id, size=part['size'])
|
||||
if part_id not in self.part_cache or self.part_cache[part_id].size != part['size']:
|
||||
self.part_cache[part_id] = Partition(root_path + part_id, part_id=part_id, size=part['size'])
|
||||
|
||||
return {k: self.part_cache[k] for k in sorted(self.part_cache)}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue