def parse_dmidecode(type):
    output = utils.execute('dmidecode', '-q', '--type', type)
    lines = output[0].split('\n')
    info = []
    multiline_values = None
    section = 0

    for line in lines:
        if len(line) != 0 and len(line.strip()) == len(line):
            info.append({})
            section = len(info) - 1
        try:
            k, v = (l.strip() for l in line.split(':', 1))
        except ValueError:
            k = line.strip()
            if not k:
                multiline_values = None
            if multiline_values:
                info[section][multiline_values].append(k)
        else:
            if not v:
                multiline_values = k.lower()
                info[section][multiline_values] = []
            else:
                info[section][k.lower()] = v

    return info
Builds list of fields for cluster information.
dataset/ETHPy150Open openstack/bareon/bareon/utils/hardware.py/parse_dmidecode--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/query.py/_BuildClusterFields