Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some linterwarnings, part 21 (from upstream) #302

Merged
merged 1 commit into from
Oct 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions monasca-thresh/submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ THRESH_STACK_SIZE=${THRESH_STACK_SIZE:-"1024k"}

echo "Waiting for MySQL to become available..."
success="false"
for i in $(seq $MYSQL_WAIT_RETRIES); do
mysqladmin status \
for i in $(seq "$MYSQL_WAIT_RETRIES"); do
if mysqladmin status \
--host="$MYSQL_DB_HOST" \
--port="$MYSQL_DB_PORT" \
--user="$MYSQL_DB_USERNAME" \
--password="$MYSQL_DB_PASSWORD" \
--connect_timeout=10
if [ $? -eq 0 ]; then
--connect_timeout=10; then
echo "MySQL is available, continuing..."
success="true"
break
Expand All @@ -39,9 +38,8 @@ if [ -n "$KAFKA_WAIT_FOR_TOPICS" ]; then
echo "Waiting for Kafka topics to become available..."
success="false"

for i in $(seq $KAFKA_WAIT_RETRIES); do
python /kafka_wait_for_topics.py
if [ $? -eq 0 ]; then
for i in $(seq "$KAFKA_WAIT_RETRIES"); do
if python /kafka_wait_for_topics.py; then
success="true"
break
else
Expand All @@ -59,18 +57,19 @@ fi

if ${NO_STORM_CLUSTER} = "true"; then
echo "Using Thresh Config file /storm/conf/thresh-config.yml. Contents:"
cat /storm/conf/thresh-config.yml | grep -vi password
grep -vi password /storm/conf/thresh-config.yml
# shellcheck disable=SC2086
JAVAOPTS="-Xmx$(python /heap.py $WORKER_MAX_HEAP_MB) -Xss$THRESH_STACK_SIZE"
echo "Submitting storm topology as local cluster using JAVAOPTS of $JAVAOPTS"
# shellcheck disable=SC2086
java $JAVAOPTS -classpath "/monasca-thresh.jar:/storm/lib/*" monasca.thresh.ThresholdingEngine /storm/conf/thresh-config.yml thresh-cluster local
exit $?
fi

echo "Waiting for storm to become available..."
success="false"
for i in $(seq $STORM_WAIT_RETRIES); do
timeout -t $STORM_WAIT_TIMEOUT storm list
if [ $? -eq 0 ]; then
for i in $(seq "$STORM_WAIT_RETRIES"); do
if timeout -t "$STORM_WAIT_TIMEOUT" storm list; then
echo "Storm is available, continuing..."
success="true"
break
Expand Down Expand Up @@ -101,7 +100,7 @@ if [ "$found" = "true" ]; then
# TODO handle upgrades
else
echo "Using Thresh Config file /storm/conf/thresh-config.yml. Contents:"
cat /storm/conf/thresh-config.yml | grep -vi password
grep -vi password /storm/conf/thresh-config.yml
echo "Submitting storm topology..."
storm jar /monasca-thresh.jar \
monasca.thresh.ThresholdingEngine \
Expand Down