Fix --sector-size argument

This commit is contained in:
2Shirt 2022-03-08 13:02:33 -07:00
parent b66f25dfea
commit 4e61025e99
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -117,12 +117,14 @@ TIMEZONE = pytz.timezone(cfg.main.LINUX_TIME_ZONE)
# Classes
class BlockPair():
"""Object for tracking source to dest recovery data."""
# pylint: disable=too-many-instance-attributes
def __init__(self, source, destination, model, working_dir):
"""Initialize BlockPair()
NOTE: source should be a wk.hw.obj.Disk() object
and destination should be a pathlib.Path() object.
"""
self.sector_size = source.details.get('phy-sec', 512)
self.source = source.path
self.destination = destination
self.map_data = {}
@ -1245,8 +1247,7 @@ def build_ddrescue_cmd(block_pair, pass_name, settings_menu):
cmd.extend(get_ddrescue_settings(settings_menu))
# Add source physical sector size (if possible)
# TODO: Fix
#cmd.append(f'--sector-size={block_pair.source.details.get("phy-sec", 512)}')
cmd.append(f'--sector-size={block_pair.sector_size}')
# Add block pair and map file
if PLATFORM == 'Darwin':