diff --git a/scripts/wk/clone/ddrescue.py b/scripts/wk/clone/ddrescue.py index aa71b6d5..756d587e 100644 --- a/scripts/wk/clone/ddrescue.py +++ b/scripts/wk/clone/ddrescue.py @@ -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') for dev_str in ('source', 'destination'): 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' update_smart_details(dev) 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, watch_file=f'{state.log_dir}/smart_source.out', ) - state.ui.add_info_pane( - percent=50, - update_layout=False, - watch_file=f'{state.log_dir}/smart_destination.out', - ) + if hasattr(state.destination, 'attributes'): + state.ui.add_info_pane( + percent=50, + update_layout=False, + watch_file=f'{state.log_dir}/smart_destination.out', + ) if PLATFORM == 'Linux': state.ui.add_worker_pane(lines=4, cmd='journal-datarec-monitor') state.ui.set_current_pane_height(DDRESCUE_OUTPUT_HEIGHT)