

def extrareport(dev):
    'Builds device report using some additional sources.\n\n    :param dev: A device file, e.g. /dev/sda.\n\n    :returns: A dict of properties.\n    '
    spec = {
        
    }
    name = os.path.basename(dev)
    try:
        with open('/sys/block/{0}/removable'.format(name)) as file:
            spec['removable'] = file.read().strip()
    except Exception:
        pass
    for key in ('state', 'timeout', 'vendor'):
        try:
            with open('/sys/block/{0}/device/{1}'.format(name, key)) as file:
                spec[key] = file.read().strip()
        except Exception:
            pass
    return spec

dataset/ETHPy150Open openstack/bareon/bareon/utils/hardware.py extrareport/original