

def parse_lspci():
    'Parses `lspci` output.\n\n    :returns: A list of dicts containing PCI devices information\n    '
    output = utils.execute('lspci', '-vmm', '-D')
    lines = output[0].split('\n')
    info = [{
        
    }]
    section = 0
    for line in lines[:(- 2)]:
        try:
            (k, v) = (l.strip() for l in line.split(':', 1))
        except ValueError:
            info.append({
                
            })
            section += 1
        else:
            info[section][k.lower()] = v
    return info

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