

def prepare_for_cross_az(compute_nodes, zones):
    if (len(zones) != 2):
        LOG.warn('cross_az is specified, but len(zones) is not 2')
        return compute_nodes
    masters = []
    slaves = []
    for node in compute_nodes:
        if (node['zone'] == zones[0]):
            masters.append(node)
        else:
            slaves.append(node)
    res = []
    for i in range(min(len(masters), len(slaves))):
        res.append(masters[i])
        res.append(slaves[i])
    return res

dataset/ETHPy150Open openstack/shaker/shaker/engine/deploy.py prepare_for_cross_az/original