

def is_disk(dev, bspec=None, uspec=None):
    'Checks if given device is a disk.\n\n    :param dev: A device file, e.g. /dev/sda.\n    :param bspec: A dict of properties which we get from blockdev.\n    :param uspec: A dict of properties which we get from udevadm.\n\n    :returns: True if device is disk else False.\n    '
    if (uspec is None):
        uspec = udevreport(dev)
    if (uspec.get('ID_CDROM') == '1'):
        return False
    if (uspec.get('DEVTYPE') == 'partition'):
        return False
    if (('MAJOR' in uspec) and (int(uspec['MAJOR']) not in VALID_MAJORS)):
        return False
    if (uspec is None):
        bspec = blockdevreport(dev)
    if (bspec.get('ro') == '1'):
        return False
    return True

dataset/ETHPy150Open openstack/bareon/bareon/utils/hardware.py is_disk/VarMisuse@103/263 `bspec`->`uspec`