Only show destination SMART data if present.
Also avoids crash when imaging
This commit is contained in:
parent
df1d2b713f
commit
a20fdf7bd3
1 changed files with 12 additions and 5 deletions
|
|
@ -1933,6 +1933,12 @@ def run_ddrescue(state, block_pair, pass_name, settings, dry_run=True) -> None:
|
||||||
now = datetime.datetime.now(tz=TIMEZONE).strftime('%Y-%m-%d %H:%M %Z')
|
now = datetime.datetime.now(tz=TIMEZONE).strftime('%Y-%m-%d %H:%M %Z')
|
||||||
for dev_str in ('source', 'destination'):
|
for dev_str in ('source', 'destination'):
|
||||||
dev = getattr(state, dev_str)
|
dev = getattr(state, dev_str)
|
||||||
|
|
||||||
|
# Safety check
|
||||||
|
if not hasattr(dev, 'attributes'):
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Update SMART data
|
||||||
out_path = f'{state.log_dir}/smart_{dev_str}.out'
|
out_path = f'{state.log_dir}/smart_{dev_str}.out'
|
||||||
update_smart_details(dev)
|
update_smart_details(dev)
|
||||||
with open(out_path, 'w', encoding='utf-8') as _f:
|
with open(out_path, 'w', encoding='utf-8') as _f:
|
||||||
|
|
@ -2065,11 +2071,12 @@ def run_recovery(state: State, main_menu, settings_menu, dry_run=True) -> None:
|
||||||
update_layout=False,
|
update_layout=False,
|
||||||
watch_file=f'{state.log_dir}/smart_source.out',
|
watch_file=f'{state.log_dir}/smart_source.out',
|
||||||
)
|
)
|
||||||
state.ui.add_info_pane(
|
if hasattr(state.destination, 'attributes'):
|
||||||
percent=50,
|
state.ui.add_info_pane(
|
||||||
update_layout=False,
|
percent=50,
|
||||||
watch_file=f'{state.log_dir}/smart_destination.out',
|
update_layout=False,
|
||||||
)
|
watch_file=f'{state.log_dir}/smart_destination.out',
|
||||||
|
)
|
||||||
if PLATFORM == 'Linux':
|
if PLATFORM == 'Linux':
|
||||||
state.ui.add_worker_pane(lines=4, cmd='journal-datarec-monitor')
|
state.ui.add_worker_pane(lines=4, cmd='journal-datarec-monitor')
|
||||||
state.ui.set_current_pane_height(DDRESCUE_OUTPUT_HEIGHT)
|
state.ui.set_current_pane_height(DDRESCUE_OUTPUT_HEIGHT)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue