aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Nelson Jr <nelson24@att.com>2018-10-14 02:47:32 -0400
committerThomas Nelson Jr arthurdent3 <nelson24@att.com>2018-10-14 02:53:16 -0400
commit287bdcbb5482f94df091c3b7b766fed0007efa2e (patch)
tree9d54801faea72ba0d26d7b71fc300bfdb4220b39
parent43792bd2e44d975e3fc5f0c7aca195524365f65c (diff)
Bug Fix to keep runcwl from failing.
Update to ensure container exits with a 0 Change-Id: I330a9488017303a6a3b08473bdedf43b9d65abd6 Issue-ID: MUSIC-147 Signed-off-by: Thomas Nelson <nelson24@nelson42.com> Signed-off-by: Thomas Nelson Jr arthurdent3 <nelson24@att.com>
-rw-r--r--distribution/cassandra_job/runcql.sh58
-rwxr-xr-xpom.xml2
-rwxr-xr-xversion.properties2
3 files changed, 51 insertions, 11 deletions
diff --git a/distribution/cassandra_job/runcql.sh b/distribution/cassandra_job/runcql.sh
index e1fb31fc..687e93b3 100644
--- a/distribution/cassandra_job/runcql.sh
+++ b/distribution/cassandra_job/runcql.sh
@@ -3,29 +3,69 @@ if [ $CASS_HOSTNAME ]; then
echo "#############################################"
echo "############## Let run cql's ################"
echo "#############################################"
+ echo "Current Variales in play"
+ echo "Default User"
+ echo "DEF_USER="$DEF_USER
+ echo "DEF_PASS=***********"
+ echo "New User"
+ echo "USERNAME="$USERNAME
+ echo "PASSWORD=***********"
+ if cqlsh -u cassandra -p cassandra -e "describe keyspaces;";
+ then
+ >&2 echo "Cassandra user still avalable, will continue as usual";
+ else
+ if cqlsh -u $USERNAME -p $PASSWORD -e "describe keyspaces;";
+ then
+ >&2 echo "Password $USERNAME in play, update Variables"
+ DEF_USER=$USERNAME
+ DEF_PASS=$PASSWORD
+ if cqlsh -u $USERNAME -p $PASSWORD -e "describe keyspaces;" | grep admin1;
+ then
+ >&2 echo "Admin table exists, everything looks good"
+ exit 0;
+ else
+ >&2 echo "Admin does not exists but password has changed. Continue as usual with proper username set"
+ >&2 echo "DEF_USER=" $DEF_USER
+ fi
+ else
+ >&2 echo "Continue and as usual"
+ fi
+ fi
echo "admin.cql file:"
cat /cql/admin.cql
- echo "Running cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin.cql ${CASS_HOSTNAME} ${PORT}"
+ >&2 echo "Running cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin.cql ${CASS_HOSTNAME} ${PORT}"
sleep 1;
- if cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin.cql ${CASS_HOSTNAME} ${PORT}; then echo "success"; else echo "failure" && exit 1;fi
+ if cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin.cql ${CASS_HOSTNAME} ${PORT};
+ then
+ >&2 echo "Success - admin.cql - Admin keyspace created";
+ else
+ >&2 echo "Failure - admin.cql";
+ exit 0;
+ fi
echo "admin_pw.cql file:"
cat /cql/admin_pw.cql
- echo "Running cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin_pw.cql ${CASS_HOSTNAME} ${PORT}"
+ >&2 echo "Running cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin_pw.cql ${CASS_HOSTNAME} ${PORT}"
sleep 1;
- if cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin_pw.cql ${CASS_HOSTNAME} ${PORT}; then echo "success"; else echo "failure" && exit 1;fi
+ if cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin_pw.cql ${CASS_HOSTNAME} ${PORT};
+ then
+ >&2 echo "Success - admin_pw.cql - Password Changed";
+ else
+ >&2 echo "Failure - admin_pw.cql";
+ exit 0;
+ fi
for f in /cql/extra/*; do
case "$f" in
*.cql)
- echo "$0: running $f" && cqlsh -u ${USERNAME} -p ${PASSWORD} -f "$f" ${CASS_HOSTNAME} ${PORT};
+ echo "$0: running $f" && cqlsh -u ${USERNAME} -p ${PASSWORD} -f "$f" ${CASS_HOSTNAME} ${PORT};
;;
- *)
- echo "$0: ignoring $f"
+ *)
+ echo "$0: ignoring $f"
;;
esac
done
else
- echo "Missing CASS_HOSTNAME";
- exit 1;
+ >&2 echo "Missing CASS_HOSTNAME";
+ exit 0;
fi
diff --git a/pom.xml b/pom.xml
index 3da9223d..22a17245 100755
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.onap.music</groupId>
<artifactId>MUSIC</artifactId>
<packaging>war</packaging>
- <version>3.0.21-SNAPSHOT</version>
+ <version>3.0.22</version>
<description>
This is the MUSIC REST interface, packaged as a war file.
</description>
diff --git a/version.properties b/version.properties
index b5dfb335..ecd85846 100755
--- a/version.properties
+++ b/version.properties
@@ -4,7 +4,7 @@
major=3
minor=0
-patch=21
+patch=22
base_version=${major}.${minor}.${patch}