

def get_device_ids(device):
    uspec = udevreport(device)
    if ('DEVLINKS' not in uspec):
        return None
    paths = []
    for element in uspec['DEVLINKS']:
        regex = re.search('disk/by.*', element)
        if regex:
            val = regex.group(0)
            paths.append(val)
    return {
        'name': device,
        'paths': paths,
    }

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