From cd4e00abe381688918ad3d5e1c6a1c258cf88705 Mon Sep 17 00:00:00 2001 From: Verdi March Date: Mon, 8 Apr 2024 16:49:39 +0800 Subject: [PATCH] pcluster-fetch-config: show error messages --- .../2.aws-parallelcluster/pcluster-fetch-config.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/1.architectures/2.aws-parallelcluster/pcluster-fetch-config.sh b/1.architectures/2.aws-parallelcluster/pcluster-fetch-config.sh index 03800803..6212156d 100755 --- a/1.architectures/2.aws-parallelcluster/pcluster-fetch-config.sh +++ b/1.architectures/2.aws-parallelcluster/pcluster-fetch-config.sh @@ -57,7 +57,9 @@ parse_args() { parse_args $@ -cluster_config_url=$(pcluster describe-cluster -n $cluster_name "${pcluster_args[@]}" | jq -r .clusterConfiguration.url) +pcluster_response=$(pcluster describe-cluster -n $cluster_name "${pcluster_args[@]}" || true) +cluster_config_url=$(echo "$pcluster_response" | jq -r .clusterConfiguration.url) +[[ "$cluster_config_url" == "null" ]] && { echo "${pcluster_response}" | jq . ; exit 1 ; } cluster_config=$(curl --silent "$cluster_config_url") # By default, auto-detect the syntax highlighter