Cleanup pylint sections
This commit is contained in:
parent
312df1ee9d
commit
41b4ffd9fb
1 changed files with 21 additions and 28 deletions
|
|
@ -598,7 +598,6 @@ def disk_attribute_check(state, test_objects) -> None:
|
|||
|
||||
|
||||
def disk_io_benchmark(state, test_objects, skip_usb=True) -> None:
|
||||
# pylint: disable=too-many-statements
|
||||
"""Disk I/O benchmark using dd."""
|
||||
LOG.info('Disk I/O Benchmark (dd)')
|
||||
aborted = False
|
||||
|
|
@ -623,31 +622,31 @@ def disk_io_benchmark(state, test_objects, skip_usb=True) -> None:
|
|||
continue
|
||||
|
||||
# Start benchmark
|
||||
if not aborted:
|
||||
std.clear_screen()
|
||||
std.print_report(test.dev.generate_report())
|
||||
test.set_status('Working')
|
||||
test_log = f'{state.log_dir}/{test.dev.path.name}_benchmark.out'
|
||||
tmux.respawn_pane(
|
||||
state.panes['I/O Benchmark'],
|
||||
watch_cmd='tail',
|
||||
watch_file=test_log,
|
||||
)
|
||||
state.update_progress_pane()
|
||||
try:
|
||||
hw_benchmark.run_io_test(test, test_log)
|
||||
except KeyboardInterrupt:
|
||||
aborted = True
|
||||
except (subprocess.CalledProcessError, TypeError, ValueError) as err:
|
||||
# Something went wrong
|
||||
LOG.error('%s', err)
|
||||
test.set_status('ERROR')
|
||||
test.report.append(std.color_string(' Unknown Error', 'RED'))
|
||||
std.clear_screen()
|
||||
std.print_report(test.dev.generate_report())
|
||||
test.set_status('Working')
|
||||
test_log = f'{state.log_dir}/{test.dev.path.name}_benchmark.out'
|
||||
tmux.respawn_pane(
|
||||
state.panes['I/O Benchmark'],
|
||||
watch_cmd='tail',
|
||||
watch_file=test_log,
|
||||
)
|
||||
state.update_progress_pane()
|
||||
try:
|
||||
hw_benchmark.run_io_test(test, test_log)
|
||||
except KeyboardInterrupt:
|
||||
aborted = True
|
||||
except (subprocess.CalledProcessError, TypeError, ValueError) as err:
|
||||
# Something went wrong
|
||||
LOG.error('%s', err)
|
||||
test.set_status('ERROR')
|
||||
test.report.append(std.color_string(' Unknown Error', 'RED'))
|
||||
|
||||
# Mark test(s) aborted if necessary
|
||||
if aborted:
|
||||
test.set_status('Aborted')
|
||||
test.report.append(std.color_string(' Aborted', 'YELLOW'))
|
||||
break
|
||||
|
||||
# Update progress after each test
|
||||
state.update_progress_pane()
|
||||
|
|
@ -662,7 +661,6 @@ def disk_io_benchmark(state, test_objects, skip_usb=True) -> None:
|
|||
|
||||
|
||||
def disk_self_test(state, test_objects) -> None:
|
||||
# pylint: disable=too-many-statements
|
||||
"""Disk self-test if available."""
|
||||
LOG.info('Disk Self-Test(s)')
|
||||
aborted = False
|
||||
|
|
@ -720,7 +718,6 @@ def disk_self_test(state, test_objects) -> None:
|
|||
|
||||
|
||||
def disk_surface_scan(state, test_objects) -> None:
|
||||
# pylint: disable=too-many-branches
|
||||
"""Read-only disk surface scan using badblocks."""
|
||||
LOG.info('Disk Surface Scan (badblocks)')
|
||||
aborted = False
|
||||
|
|
@ -745,15 +742,11 @@ def disk_surface_scan(state, test_objects) -> None:
|
|||
[None, 'BLUE', None, 'CYAN', None],
|
||||
sep='',
|
||||
)
|
||||
#std.print_colored([disk.path.name, disk.description], [None, 'BLUE'])
|
||||
std.print_report(failed_attributes)
|
||||
std.print_standard('')
|
||||
|
||||
# Run surface scans
|
||||
for test in reversed(test_objects):
|
||||
if test.disabled:
|
||||
# Skip
|
||||
continue
|
||||
for test in reversed([test for test in test_objects if not test.disabled]):
|
||||
|
||||
# Start thread
|
||||
test_log = f'{state.log_dir}/{test.dev.path.name}_badblocks.log'
|
||||
|
|
|
|||
Loading…
Reference in a new issue