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
 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