Fix for unpartitioned drives.
This commit is contained in:
parent
9cd0a4b73f
commit
252dfb295b
|
|
@ -500,6 +500,7 @@ def disk_info(drive, *positionals, **kwargs):
|
||||||
info = json.loads(b''.join(sys_command(f'lsblk -J -o "NAME,SIZE,FSTYPE,LABEL" {drive}', *positionals, **lkwargs)).decode('UTF_8'))['blockdevices'][0]
|
info = json.loads(b''.join(sys_command(f'lsblk -J -o "NAME,SIZE,FSTYPE,LABEL" {drive}', *positionals, **lkwargs)).decode('UTF_8'))['blockdevices'][0]
|
||||||
fileformats = []
|
fileformats = []
|
||||||
labels = []
|
labels = []
|
||||||
|
if 'children' in info: ## Might not be partitioned yet
|
||||||
for child in info['children']:
|
for child in info['children']:
|
||||||
if child['fstype'] != None:
|
if child['fstype'] != None:
|
||||||
fileformats.append(child['fstype'])
|
fileformats.append(child['fstype'])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue