

def _get_cluster_by_id(self, cluster_id):
    'Get cluster by cluster ID.\n\n        Get cluster by cluster ID. If `cluster_id` is `None` then return\n        first cluster from the list.\n\n        :param cluster_id: cluster ID\n        :type cluster_id: int\n        :return: cluster\n        '
    if (cluster_id is None):
        return cluster.clusters[0]
    for cluster in self.clusters:
        if (cluster.id == cluster_id):
            return cluster
    raise Exception('Cluster with ID "{0}" was not found.'.format(cluster_id))

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/base.py EnvironmentManager._get_cluster_by_id/VarMisuse@24/128 `self`->`cluster`