From 000a827f039a560c2ea6f249dcc3b020d18008b3 Mon Sep 17 00:00:00 2001 From: Omar Rivera Date: Thu, 2 Feb 2017 16:46:08 -0600 Subject: [PATCH] Updates pecan_populate.sh Change-Id: I4461d8becd3eeaa52ade205b6428d7140b01992d --- tools/utils/pecan_populate.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/utils/pecan_populate.sh b/tools/utils/pecan_populate.sh index 7fac570..4295631 100644 --- a/tools/utils/pecan_populate.sh +++ b/tools/utils/pecan_populate.sh @@ -1,13 +1,14 @@ PARSED_VAL=`grep keyspace /etc/valet/valet.conf |awk 'BEGIN{FS="="}{print $NF}'` KEYSPACE_NAME="$PARSED_VAL" sed -i -e "s/#VALET_KEYSPACE#/${KEYSPACE_NAME}/g" /opt/app/aic-valet-tools/populate.cql -/usr/bin/cqlsh -f /opt/app/aic-valet-tools/populate.cql cassandra_cnt=`/usr/bin/cqlsh -e "describe KEYSPACE ${KEYSPACE_NAME};"|grep -c CREATE` -if [ $cassandra_cnt -gt 12 ]; then - exit $cassandra_cnt +if [ $cassandra_cnt -gt 15 ]; then + exit 0 fi /usr/bin/cqlsh -e "drop KEYSPACE ${KEYSPACE_NAME};" sleep 5 +/usr/bin/cqlsh -f /opt/app/aic-valet-tools/populate.cql +sleep 5 pecan populate /var/www/valet/config.py >> /var/log/valet/pecan_populate.out sleep 5 -exit $cassandra_cnt +exit 0