diff --git a/scripts/wk/clone/ddrescue.py b/scripts/wk/clone/ddrescue.py index 7bf41495..a7b47635 100644 --- a/scripts/wk/clone/ddrescue.py +++ b/scripts/wk/clone/ddrescue.py @@ -30,6 +30,7 @@ from wk.cfg.ddrescue import ( from wk.hw import disk as hw_disk from wk.hw.smart import ( check_attributes, + enable_smart, smart_status_ok, update_smart_details, ) @@ -814,6 +815,12 @@ class State(): pathlib.Path(self.destination.path), ) + # Update SMART data + ## TODO: Verify if needed + for dev in (self.source, self.destination): + enable_smart(dev) + update_smart_details(dev) + # Safety Checks #1 if self.mode == 'Clone': self.safety_check_destination() diff --git a/scripts/wk/hw/diags.py b/scripts/wk/hw/diags.py index f04ac04a..1c321f4c 100644 --- a/scripts/wk/hw/diags.py +++ b/scripts/wk/hw/diags.py @@ -198,6 +198,9 @@ class State(): # Add HW Objects self.system = hw_system.System() self.disks = hw_disk.get_disks(skip_kits=True) + for disk in self.disks: + hw_smart.enable_smart(disk) + hw_smart.update_smart_details(disk) # Add test objects for name, details in menu.options.items(): diff --git a/scripts/wk/hw/disk.py b/scripts/wk/hw/disk.py index 659a6bc1..eaea2fbf 100644 --- a/scripts/wk/hw/disk.py +++ b/scripts/wk/hw/disk.py @@ -16,10 +16,8 @@ from wk.cfg.python import DATACLASS_DECORATOR_KWARGS from wk.exe import get_json_from_command, run_program from wk.hw.test import Test from wk.hw.smart import ( - enable_smart, generate_attribute_report, get_known_disk_attributes, - update_smart_details, ) from wk.std import PLATFORM, color_string, strip_colors @@ -64,15 +62,11 @@ class Disk: self.update_details() self.set_description() self.known_attributes = get_known_disk_attributes(self.model) - enable_smart(self) - update_smart_details(self) if not self.attributes and self.bus == 'USB': # Try using SAT LOG.warning('Using SAT for smartctl for %s', self.path) self.notes = [] self.use_sat = True - enable_smart(self) - update_smart_details(self) self.initial_attributes = copy.deepcopy(self.attributes) if not self.is_4k_aligned(): self.add_note('One or more partitions are not 4K aligned', 'YELLOW') diff --git a/scripts/wk/std.py b/scripts/wk/std.py index af4b9682..b3ad837e 100644 --- a/scripts/wk/std.py +++ b/scripts/wk/std.py @@ -1096,9 +1096,10 @@ def upload_debug_report(report, compress=True, reason='DEBUG'): url = f'{CRASH_SERVER["Url"]}/{filename}' response = requests.put( url, + auth=(CRASH_SERVER['User'], CRASH_SERVER.get('Pass', '')), data=xz_report if compress else report, headers=headers, - auth=(CRASH_SERVER['User'], CRASH_SERVER.get('Pass', '')), + timeout=60, ) # Check response