Fixed the startup.sh script in the sdc-onboard-db-init-docker. 93/91093/2
authork.kedron <k.kedron@partner.samsung.com>
Tue, 9 Jul 2019 13:44:54 +0000 (15:44 +0200)
committerOfir Sonsino <ofir.sonsino@intl.att.com>
Wed, 10 Jul 2019 13:38:49 +0000 (13:38 +0000)
Changed the instruction order to get the cqlsh command status.

Issue-ID: SDC-2425
Signed-off-by: Krystian Kedron <k.kedron@partner.samsung.com>
Change-Id: I173244af91e091d5cbb6979a8c5819b2646d6196

openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/startup.sh

index c806102..02354db 100644 (file)
@@ -18,21 +18,21 @@ echo "[Info] Going to initialize sdc onboard cassandra: user=$SDC_USER; host=$CS
 echo "[Info] Initializing onboard keyspaces"
 date;
 cqlsh -u $SDC_USER -p $SDC_PASSWORD -f init_keyspaces.cql $CS_HOST $CS_PORT
+rc=$?
 date;
 
-rc=$?
-if [[ $rc != 0 ]]; then 
-       echo "[Error] Failed to initialize onboard keyspaces"; 
-       exit $rc; 
+if [[ $rc != 0 ]]; then
+       echo "[Error] Failed to initialize onboard keyspaces";
+       exit $rc;
 fi
 
 echo "[Info] Initializing onboard schemas"
 date;
 cqlsh -u $SDC_USER -p $SDC_PASSWORD -f init_schemas.cql $CS_HOST $CS_PORT
+rc=$?
 date;
 
-rc=$?
-if [[ $rc != 0 ]]; then 
-       echo "[Error] Failed to initialize onboard schemas"; 
-       exit $rc; 
-fi
\ No newline at end of file
+if [[ $rc != 0 ]]; then
+       echo "[Error] Failed to initialize onboard schemas";
+       exit $rc;
+fi