Permalink
Browse files

fix some of the readiness probe error messages.

  • Loading branch information...
mwringe committed Jun 27, 2016
1 parent d86d766 commit cf2c6d0088426e285178a9e3057156e9a90dc56f
Showing with 14 additions and 2 deletions.
  1. +6 −1 cassandra/cassandra-docker-ready.sh
  2. +8 −1 hawkular-metrics/hawkular-metrics-readiness.py
@@ -24,8 +24,13 @@ HOSTIP=`cat /etc/hosts | grep $HOSTNAME | awk '{print $1}' | head -n 1`
# Get the status of this machine from the Cassandra nodetool
STATUS=`nodetool status | grep $HOSTIP | awk '{print $1}'`
+if [ ${STATUS:-""} = "" ]; then
+ echo "Could not get the Cassandra status. This may mean that the Cassandra instance is not up yet. Will try again"
+ exit 1
+fi
+
# Once the status is Up and Normal, then we are ready
-if [ $STATUS = "UN" ]; then
+if [ ${STATUS} = "UN" ]; then
echo "Cassandra is in the up and normal state. It is now ready"
exit 0
else
@@ -33,9 +33,16 @@
# if the metrics service is started then we are good
if (jsonResponse["MetricsService"] == "STARTED"):
exit(0)
+ else:
+ print "The MetricService is not yet in the STARTED state [" + jsonResponse["MetricsService"] + "]. We need to wait until its in the STARTED state."
+ exit(1)
+ else:
+ print "Could not connect to the Hawkular Metrics' status endpoint (" + statusCode + "). This may be due to Hawkular Metrics not being ready yet. Will try again"
+ exit(1)
except Exception as e:
- print "Failed to access the status endpoint : %s." % e
+ print "Failed to access the status endpoint : %s. This may be due to Hawkular Metrics not being ready yet. Will try again." % e
exit(1)
# conditions were not passed, exit with an error code
+print "Could not verify a connection to the Hawkular Metrics' status endpoint"
exit(1)

0 comments on commit cf2c6d0

Please sign in to comment.