

def blockdevreport(blockdev):
    'Builds device blockdev report.\n\n    :param blockdev: A block device file, e.g. /dev/sda.\n\n    :returns: A dict of blockdev properties.\n    '
    cmd = ['blockdev', '--getsz', '--getro', '--getss', '--getpbsz', '--getsize64', '--getiomin', '--getioopt', '--getra', '--getalignoff', '--getmaxsect', blockdev]
    opts = [o[5:] for o in cmd if o.startswith('--get')]
    report = utils.execute(*cmd, check_exit_code=[0])[0]
    return dict(zip(opts, report.splitlines()))

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