def get_device_info(device, disks=True):
    try:
        uspec = udevreport(device)
        espec = extrareport(device)
        bspec = blockdevreport(device)
    except (KeyError, ValueError, TypeError,
            errors.ProcessExecutionError) as e:
        LOG.warning('Skipping block device %s. '
                    'Failed to get all information about the device: %s',
                    device, e)
        return
    # if device is not disk, skip it
    if disks and not is_disk(device, bspec=bspec, uspec=uspec):
        return

    bdev = {
        'device': device,
        # NOTE(agordeev): blockdev gets 'startsec' from sysfs,
        # 'size' is determined by ioctl call.
        # This data was not actually used by bareon,
        # so it can be removed without side effects.
        'uspec': uspec,
        'bspec': bspec,
        'espec': espec
    }
    return bdev
dataset/ETHPy150Open openstack/bareon/bareon/utils/hardware.py/get_device_info/original