'Exec into the elasticsearch pods and check the cluster health. Returns: list of errors'

def check_es_cluster_health(self, pods_by_name):

    errors = []
    for pod_name in pods_by_name.keys():
        cluster_health_cmd = self._build_es_curl_cmd(pod_name, 'https://localhost:9200/_cluster/health?pretty=true')
        cluster_health_data = self.exec_oc(cluster_health_cmd, [])
        try:
            health_res = json.loads(cluster_health_data)
            if ((not health_res) or (not health_res.get('status'))):
                raise ValueError()
        except ValueError:
            errors.append(OpenShiftCheckException('BadEsResponse', 'Could    not    retrieve    cluster    health    status    from    logging    ES    pod    "{pod}".\nResponse    was:\n{output}'.format(pod=pod_name, output=cluster_health_data)))
            continue
        if (health_res['status'] not in ['green', 'yellow']):
            errors.append(OpenShiftCheckException('EsClusterHealthRed', 'Elasticsearch    cluster    health    status    is    RED    according    to    pod    "{}"'.format(pod_name)))
    return errors
