Show volume usage for all devices
* Don't CoreStorage scans for failed devices * Fixes issue #25
This commit is contained in:
parent
3216c2f46b
commit
f0179ec962
2 changed files with 42 additions and 40 deletions
|
|
@ -250,7 +250,9 @@ def get_mounted_volumes():
|
||||||
mounted_volumes.extend(item.get('children', []))
|
mounted_volumes.extend(item.get('children', []))
|
||||||
return {item['source']: item for item in mounted_volumes}
|
return {item['source']: item for item in mounted_volumes}
|
||||||
|
|
||||||
def mount_volumes(all_devices=True, device_path=None, read_write=False):
|
def mount_volumes(
|
||||||
|
all_devices=True, device_path=None,
|
||||||
|
read_write=False, core_storage=True):
|
||||||
"""Mount all detected filesystems."""
|
"""Mount all detected filesystems."""
|
||||||
report = {}
|
report = {}
|
||||||
cmd = [
|
cmd = [
|
||||||
|
|
@ -261,6 +263,7 @@ def mount_volumes(all_devices=True, device_path=None, read_write=False):
|
||||||
cmd.append(device_path)
|
cmd.append(device_path)
|
||||||
|
|
||||||
# Check for Apple CoreStorage volumes first
|
# Check for Apple CoreStorage volumes first
|
||||||
|
if core_storage:
|
||||||
find_core_storage_volumes(device_path)
|
find_core_storage_volumes(device_path)
|
||||||
|
|
||||||
# Get list of block devices
|
# Get list of block devices
|
||||||
|
|
|
||||||
|
|
@ -668,12 +668,11 @@ def post_drive_results(ticket_number):
|
||||||
# Used space
|
# Used space
|
||||||
report.append('')
|
report.append('')
|
||||||
report.append('Volumes:')
|
report.append('Volumes:')
|
||||||
if dev_failed or dev_unknown:
|
core_storage = dev_passed and not dev_failed and not dev_unknown
|
||||||
report.append('Skipped due to error(s) above.')
|
|
||||||
else:
|
|
||||||
volume_report = mount_volumes(
|
volume_report = mount_volumes(
|
||||||
all_devices=False,
|
all_devices=False,
|
||||||
device_path='/dev/{}'.format(name))
|
device_path='/dev/{}'.format(name),
|
||||||
|
core_storage=core_storage)
|
||||||
for vol_path, vol_data in sorted(volume_report.items()):
|
for vol_path, vol_data in sorted(volume_report.items()):
|
||||||
vol_report = [
|
vol_report = [
|
||||||
vol_path,
|
vol_path,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue