def _is_cluster_active(self, cluster): cluster_status = cluster.status.lower() if cluster_status == "error": raise exceptions.SaharaClusterFailure( name=cluster.name, action="start", reason=cluster.status_description) return cluster_status == "active"
def all_clusters_active(self, dct): for cluster, client in dct.items(): cluster_status = cluster.status.lower() if cluster_status == "error": raise exceptions.SaharaClusterFailure( name=cluster.name, action="start", reason=cluster.status_description) elif cluster_status != "active": return False return True