From 5b0257de982b4a77ea877e9ba07429422aef29c8 Mon Sep 17 00:00:00 2001 From: arnaudfroidmont Date: Thu, 8 Dec 2022 22:16:15 -0700 Subject: [PATCH] Add a warning about scaling cluster --- bin/resize.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/resize.py b/bin/resize.py index 297d4532..576d9298 100644 --- a/bin/resize.py +++ b/bin/resize.py @@ -434,11 +434,14 @@ def get_summary(comp_ocid,cluster_name): CN = True cn_summaries = computeManagementClient.list_cluster_networks(comp_ocid,display_name=cluster_name).data running_clusters = 0 + scaling_clusters = 0 cn_summary=None for cn_summary_tmp in cn_summaries: if cn_summary_tmp.lifecycle_state == "RUNNING": cn_summary = cn_summary_tmp running_clusters = running_clusters + 1 + elif cn_summary_tmp.lifecycle_state == "SCALING": + scaling_clusters = scaling_clusters + 1 if running_clusters == 0: cn_summaries = computeManagementClient.list_instance_pools(comp_ocid,display_name=cluster_name).data if len(cn_summaries) > 0: @@ -446,9 +449,14 @@ def get_summary(comp_ocid,cluster_name): for cn_summary_tmp in cn_summaries: if cn_summary_tmp.lifecycle_state == "RUNNING": cn_summary = cn_summary_tmp - running_clusters = running_clusters + 1 + running_clusters = running_clusters + 1 + elif cn_summary_tmp.lifecycle_state == "SCALING": + scaling_clusters = scaling_clusters + 1 if running_clusters == 0: - print("The cluster was not found") + if scaling_clusters: + print("No running cluster was found but there is a cluster in SCALING mode, try rerunning in a moment") + else: + print("The cluster was not found") return None,None,True if running_clusters > 1: print("There were multiple running clusters with this name, we selected the one with OCID:"+cn_summary.id)