Get correct size for child dev under macOS

This commit is contained in:
2Shirt 2021-04-14 02:16:58 -06:00
parent a4ee7b890c
commit 20fe08dbb4
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -683,6 +683,13 @@ def get_disk_details_macos(path):
else:
dev['parent'] = dev.pop('ParentWholeDisk', None)
# Fix details if main dev is a child
for child in details['children']:
if path == child['path']:
for key in ('fstype', 'label', 'name', 'size'):
details[key] = child[key]
break
# Done
return details