Attempting to correct some inconsitencies in disk-parent reporting.
This commit is contained in:
parent
0370c44ed8
commit
8f096001b6
|
|
@ -220,12 +220,9 @@ class Partition():
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def real_device(self):
|
def real_device(self):
|
||||||
if not self._encrypted:
|
for blockdevice in json.loads(b''.join(sys_command('lsblk -J')).decode('UTF-8'))['blockdevices']:
|
||||||
return self.path
|
if (parent := self.find_parent_of(blockdevice, os.path.basename(self.path))):
|
||||||
else:
|
return f"/dev/{parent}"
|
||||||
for blockdevice in json.loads(b''.join(sys_command('lsblk -J')).decode('UTF-8'))['blockdevices']:
|
|
||||||
if (parent := self.find_parent_of(blockdevice, os.path.basename(self.path))):
|
|
||||||
return f"/dev/{parent}"
|
|
||||||
# raise DiskError(f'Could not find appropriate parent for encrypted partition {self}')
|
# raise DiskError(f'Could not find appropriate parent for encrypted partition {self}')
|
||||||
return self.path
|
return self.path
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue