diff --git a/probert/storage.py b/probert/storage.py index 453ddac..27ad6b8 100644 --- a/probert/storage.py +++ b/probert/storage.py @@ -21,7 +21,7 @@ import subprocess from probert.utils import ( - read_sys_block_size_bytes, + read_sys_devpath_size_bytes, sane_block_devices, udev_get_attributes, ) @@ -135,11 +135,12 @@ def _extract_partition_table(devname): blockdev = {} for device in interesting_storage_devs(context): devname = device.properties['DEVNAME'] + devpath = device.properties['DEVPATH'] attrs = udev_get_attributes(device) # update the size attr as it may only be the number # of blocks rather than size in bytes. - attrs['size'] = \ - str(read_sys_block_size_bytes(devname)) + attrs['size'] = str(read_sys_devpath_size_bytes( + devpath, log_inexistent=True)) # When dereferencing device[prop], pyudev calls bytes.decode(), which # can fail if the value is invalid utf-8. We don't want a single # invalid value to completely prevent probing. So we iterate