Adjusted formatting
This commit is contained in:
parent
a5d92537f5
commit
dc8416b5f7
1 changed files with 10 additions and 9 deletions
|
|
@ -117,6 +117,8 @@ class DiskObj():
|
||||||
self.tests = OrderedDict()
|
self.tests = OrderedDict()
|
||||||
self.get_details()
|
self.get_details()
|
||||||
self.get_smart_details()
|
self.get_smart_details()
|
||||||
|
self.description = '{size:>6} ({tran}) {model} {serial}'.format(
|
||||||
|
**self.lsblk)
|
||||||
|
|
||||||
def check_attributes(self, silent=False):
|
def check_attributes(self, silent=False):
|
||||||
"""Check NVMe / SMART attributes for errors."""
|
"""Check NVMe / SMART attributes for errors."""
|
||||||
|
|
@ -177,8 +179,7 @@ class DiskObj():
|
||||||
if not brief:
|
if not brief:
|
||||||
report.append('{BLUE}Device: {dev_path}{CLEAR}'.format(
|
report.append('{BLUE}Device: {dev_path}{CLEAR}'.format(
|
||||||
dev_path=self.path, **COLORS))
|
dev_path=self.path, **COLORS))
|
||||||
report.append(' {size:>6} ({tran}) {model} {serial}'.format(
|
report.append(' {}'.format(self.description))
|
||||||
**self.lsblk))
|
|
||||||
|
|
||||||
# Warnings
|
# Warnings
|
||||||
if self.nvme_attributes:
|
if self.nvme_attributes:
|
||||||
|
|
@ -718,14 +719,14 @@ def run_audio_test():
|
||||||
pause('Press Enter to return to main menu... ')
|
pause('Press Enter to return to main menu... ')
|
||||||
|
|
||||||
def run_badblocks_test(state, test):
|
def run_badblocks_test(state, test):
|
||||||
"""TODO"""
|
"""Run a read-only surface scan with badblocks."""
|
||||||
# Bail early
|
# Bail early
|
||||||
if test.disabled:
|
if test.disabled:
|
||||||
return
|
return
|
||||||
print_log('Starting badblocks test for {}'.format(test.dev.path))
|
print_log('Starting badblocks test for {}'.format(test.dev.path))
|
||||||
tmux_update_pane(
|
tmux_update_pane(
|
||||||
state.panes['Top'], text='{}\n{}'.format(
|
state.panes['Top'],
|
||||||
TOP_PANE_TEXT, 'badblocks'))
|
text='{}\nbadblocks: {}'.format(TOP_PANE_TEXT, test.dev.description))
|
||||||
print_standard('TODO: run_badblocks_test({})'.format(
|
print_standard('TODO: run_badblocks_test({})'.format(
|
||||||
test.dev.path))
|
test.dev.path))
|
||||||
test.started = True
|
test.started = True
|
||||||
|
|
@ -1022,8 +1023,7 @@ def run_nvme_smart_tests(state, test):
|
||||||
test.update_status()
|
test.update_status()
|
||||||
tmux_update_pane(
|
tmux_update_pane(
|
||||||
state.panes['Top'],
|
state.panes['Top'],
|
||||||
text='{t}\nDisk Health: {size:>6} ({tran}) {model} {serial}'.format(
|
text='{}\nDisk Health: {}'.format(TOP_PANE_TEXT, test.dev.description))
|
||||||
t=TOP_PANE_TEXT, **test.dev.lsblk))
|
|
||||||
update_progress_pane(state)
|
update_progress_pane(state)
|
||||||
|
|
||||||
# NVMe
|
# NVMe
|
||||||
|
|
@ -1062,7 +1062,7 @@ def run_nvme_smart_tests(state, test):
|
||||||
# Create monitor pane
|
# Create monitor pane
|
||||||
test.smart_out = '{}/smart.out'.format(global_vars['TmpDir'])
|
test.smart_out = '{}/smart.out'.format(global_vars['TmpDir'])
|
||||||
with open(test.smart_out, 'w') as f:
|
with open(test.smart_out, 'w') as f:
|
||||||
f.write('SMART self-test status:\n Pending')
|
f.write('SMART self-test status:\n Starting...')
|
||||||
state.panes['smart'] = tmux_split_window(
|
state.panes['smart'] = tmux_split_window(
|
||||||
lines=3, vertical=True, watch=test.smart_out)
|
lines=3, vertical=True, watch=test.smart_out)
|
||||||
|
|
||||||
|
|
@ -1089,7 +1089,8 @@ def run_nvme_smart_tests(state, test):
|
||||||
# Update progress file
|
# Update progress file
|
||||||
with open(test.smart_out, 'w') as f:
|
with open(test.smart_out, 'w') as f:
|
||||||
f.write('SMART self-test status:\n {}'.format(
|
f.write('SMART self-test status:\n {}'.format(
|
||||||
test.dev.smart_self_test['status'].get('string', 'UNKNOWN')))
|
test.dev.smart_self_test['status'].get(
|
||||||
|
'string', 'UNKNOWN').capitalize()))
|
||||||
|
|
||||||
# Check if test has finished
|
# Check if test has finished
|
||||||
if 'remaining_percent' not in test.dev.smart_self_test['status']:
|
if 'remaining_percent' not in test.dev.smart_self_test['status']:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue