Eli Mesika has uploaded a new change for review.

Change subject: core:restore.sh fails to drop existing database...
......................................................................

core:restore.sh fails to drop existing database...

restore.sh fails to drop existing database and continues running

Adding a check on the dropdb command status and existing if not
succeeded.

Change-Id: If9d33e0011cdac6bb0d9b153cc4f4a118c7b4aaf
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=929359
Signed-off-by: Eli Mesika <[email protected]>
---
M backend/manager/dbscripts/restore.sh
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/98/13498/1

diff --git a/backend/manager/dbscripts/restore.sh 
b/backend/manager/dbscripts/restore.sh
index aa6532d..9204f3f 100755
--- a/backend/manager/dbscripts/restore.sh
+++ b/backend/manager/dbscripts/restore.sh
@@ -64,6 +64,10 @@
         exit 1
     else
         dropdb  -h ${SERVERNAME} -p ${PORT} -U ${USERNAME} ${DATABASE}
+        if [ $? -ne 0 ]; then
+            echo "Failed to drop database ${DATABASE}."
+            exit 2
+        fi
     fi
 fi
 


--
To view, visit http://gerrit.ovirt.org/13498
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If9d33e0011cdac6bb0d9b153cc4f4a118c7b4aaf
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to