def METHOD_NAME(self, block_devices):
    device_names = {os.path.basename(d): d for d in block_devices}
    sysfs_block_devices = set(os.listdir(SYSFS_BLOCK_DEVICE_PATH))
    common_device_names = sysfs_block_devices.intersection(set(device_names.keys()))
    result = {}
    for common_device_name in common_device_names:
        sysfs_path = os.path.join(SYSFS_BLOCK_DEVICE_PATH, common_device_name)
        full_sysfs_path = os.readlink(sysfs_path)
        path_parts = full_sysfs_path.split("/")
        end_index = None
        for index, part in enumerate(path_parts):
            if self.udp.search(part):
                end_index = index
        if end_index is None:
            LOG.debug(
                "Did not find suitable usb folder for usb info: %s", full_sysfs_path
            )
            continue
        usb_info_rel_path = path_parts[: end_index + 1]
        usb_info_path = os.path.join(
            SYSFS_BLOCK_DEVICE_PATH, os.sep.join(usb_info_rel_path)
        )
        vendor_id = None
        product_id = None
        vendor_id_file_paths = os.path.join(usb_info_path, "idVendor")
        product_id_file_paths = os.path.join(usb_info_path, "idProduct")
        try:
            with open(vendor_id_file_paths, "r") as vendor_file:
                vendor_id = vendor_file.read().strip()
        except OSError as e:
            LOG.debug(
                "Failed to read vendor id file %s weith error:",
                vendor_id_file_paths,
                e,
            )
        try:
            with open(product_id_file_paths, "r") as product_file:
                product_id = product_file.read().strip()
        except OSError as e:
            LOG.debug(
                "Failed to read product id file %s weith error:",
                product_id_file_paths,
                e,
            )
        result[device_names[common_device_name]] = {
            "vendor_id": vendor_id,
            "product_id": product_id,
        }
    return result