'Tell servers to commit rebalance changes.'

def RebalanceCommit(self):

    rebalance.SaveCommitInformation(self.rebalance)
    body = self.rebalance.SerializeToString()
    size = len(body)
    headers = {'Content-Length': size}
    for (i, pool) in enumerate(self.rebalance_pool):
        try:
            res = pool.urlopen('POST', '/rebalance/perform', headers=headers, body=body)
            if (res.status != constants.RESPONSE_OK):
                logging.error('Server    %d    failed    to    perform    transaction    %s', i, self.rebalance.id)
                self.CancelRebalancing()
                return None
            stat = rdf_data_server.DataServerState()
            stat.ParseFromString(res.data)
            data_server = self.servers[i]
            data_server.UpdateState(stat)
        except urllib3.exceptions.MaxRetryError:
            self.CancelRebalancing()
            return None
    mapping = self.rebalance.mapping
    for (i, serv) in enumerate(list(self.mapping.servers)):
        serv.interval = mapping.servers[i].interval
    self.rebalance.mapping = self.mapping
    self.service.SaveServerMapping(self.mapping)
    rebalance.DeleteCommitInformation(self.rebalance)
    rebalance.RemoveDirectory(self.rebalance)
    self.CancelRebalancing()
    return self.mapping
