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