Remove SMARTSelfTestInProgressError sections
Going forward this is a non-blocking error.
This commit is contained in:
parent
d667695e9e
commit
95cd3b645d
3 changed files with 2 additions and 45 deletions
|
|
@ -30,7 +30,6 @@ from wk.cfg.ddrescue import (
|
|||
from wk.hw import disk as hw_disk
|
||||
from wk.hw.smart import (
|
||||
CriticalHardwareError,
|
||||
SMARTSelfTestInProgressError,
|
||||
safety_checks,
|
||||
update_smart_details,
|
||||
)
|
||||
|
|
@ -1500,8 +1499,6 @@ def check_destination_health(destination):
|
|||
safety_checks(destination)
|
||||
except CriticalHardwareError:
|
||||
result = 'Critical hardware error detected on destination'
|
||||
except SMARTSelfTestInProgressError:
|
||||
result = 'SMART self-test in progress on destination'
|
||||
|
||||
# Done
|
||||
return result
|
||||
|
|
|
|||
|
|
@ -110,10 +110,9 @@ class State():
|
|||
tmux.kill_pane(_id)
|
||||
self.panes.pop(key)
|
||||
|
||||
def disk_safety_checks(self, prep=False, wait_for_self_tests=True) -> None:
|
||||
def disk_safety_checks(self, prep=False) -> None:
|
||||
# pylint: disable=too-many-branches,too-many-statements
|
||||
"""Run disk safety checks."""
|
||||
self_tests_in_progress = False
|
||||
for disk in self.disks:
|
||||
disable_tests = False
|
||||
|
||||
|
|
@ -136,27 +135,6 @@ class State():
|
|||
'Critical hardware error detected during diagnostics',
|
||||
'YELLOW',
|
||||
)
|
||||
except hw_smart.SMARTSelfTestInProgressError as err:
|
||||
if prep:
|
||||
std.print_warning(f'SMART self-test(s) in progress for {disk.path}')
|
||||
if std.ask('Continue with all tests disabled for this device?'):
|
||||
disable_tests = True
|
||||
else:
|
||||
std.print_standard('Diagnostics aborted.')
|
||||
std.print_standard(' ')
|
||||
std.pause('Press Enter to exit...')
|
||||
raise SystemExit(1) from err
|
||||
elif wait_for_self_tests:
|
||||
self_tests_in_progress = True
|
||||
else:
|
||||
# Other tests will NOT be disabled
|
||||
LOG.warning('SMART data may not be reliable for: %s', disk.path)
|
||||
# Add note to report
|
||||
if 'Disk Self-Test' in disk.tests:
|
||||
disk.tests['Disk Self-Test'].failed = True
|
||||
disk.tests['Disk Self-Test'].report.append(
|
||||
std.color_string('Please manually review SMART data', 'YELLOW'),
|
||||
)
|
||||
else:
|
||||
if (
|
||||
'Disk Attributes' in disk.tests
|
||||
|
|
@ -188,13 +166,6 @@ class State():
|
|||
if disable_tests:
|
||||
disk.disable_disk_tests()
|
||||
|
||||
# Wait for self-test(s)
|
||||
if self_tests_in_progress:
|
||||
std.print_warning('SMART self-test(s) in progress')
|
||||
std.print_standard('Waiting 60 seconds before continuing...')
|
||||
std.sleep(60)
|
||||
self.disk_safety_checks(wait_for_self_tests=False)
|
||||
|
||||
def fix_tmux_layout(self, forced=True) -> None:
|
||||
"""Fix tmux layout based on cfg.hw.TMUX_LAYOUT."""
|
||||
try:
|
||||
|
|
@ -921,9 +892,7 @@ def run_diags(state, menu, quick_mode=False) -> None:
|
|||
|
||||
# Run safety checks
|
||||
if group.name.startswith('Disk'):
|
||||
state.disk_safety_checks(
|
||||
wait_for_self_tests=group.name != 'Disk Attributes',
|
||||
)
|
||||
state.disk_safety_checks()
|
||||
|
||||
# Handle aborts
|
||||
if aborted:
|
||||
|
|
|
|||
|
|
@ -28,9 +28,6 @@ LOG = logging.getLogger(__name__)
|
|||
class CriticalHardwareError(RuntimeError):
|
||||
"""Exception used for critical hardware failures."""
|
||||
|
||||
class SMARTSelfTestInProgressError(RuntimeError):
|
||||
"""Exception used when a SMART self-test is in progress."""
|
||||
|
||||
|
||||
# Functions
|
||||
def abort_self_test(dev) -> None:
|
||||
|
|
@ -378,12 +375,6 @@ def safety_checks(dev) -> None:
|
|||
if blocking_event_encountered:
|
||||
raise CriticalHardwareError(f'Critical error(s) for: {dev.path}')
|
||||
|
||||
# SMART self-test status
|
||||
if self_test_in_progress(dev):
|
||||
msg = f'SMART self-test in progress for: {dev.path}'
|
||||
LOG.error(msg)
|
||||
raise SMARTSelfTestInProgressError(msg)
|
||||
|
||||
|
||||
def self_test_in_progress(dev) -> bool:
|
||||
"""Check if SMART self-test is in progress, returns bool."""
|
||||
|
|
|
|||
Loading…
Reference in a new issue