Eli Mesika has uploaded a new change for review.

Change subject: core: taskcleaner.sh should treat null argument as -h
......................................................................

core: taskcleaner.sh should treat null argument as -h

Adding a check fot the USERNAME which is mandatory.

Change-Id: I8505ff75d1b22eb27b3aa928d254cc6830b9f4c5
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=924246
Signed-off-by: Eli Mesika <emes...@redhat.com>
---
M backend/manager/tools/dbutils/taskcleaner.sh
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/19/13319/1

diff --git a/backend/manager/tools/dbutils/taskcleaner.sh 
b/backend/manager/tools/dbutils/taskcleaner.sh
index e2ceafe..a3afdc6 100755
--- a/backend/manager/tools/dbutils/taskcleaner.sh
+++ b/backend/manager/tools/dbutils/taskcleaner.sh
@@ -25,7 +25,7 @@
 set_defaults
 
 usage() {
-    printf "Usage: ${ME} [-h] [-s server] [-p PORT]] [-d DATABASE] [-u 
USERNAME] [-l LOGFILE]  [-t taskId] [-c commandId] [-z] [-R] [-C] [-J] [-A] 
[-q] [-v]\n"
+    printf "Usage: ${ME} [-h] [-s server] [-p PORT]] [-d DATABASE] -u USERNAME 
[-l LOGFILE]  [-t taskId] [-c commandId] [-z] [-R] [-C] [-J] [-A] [-q] [-v]\n"
     printf "\n"
     printf "\t-s SERVERNAME - The database servername for the database  (def. 
${SERVERNAME})\n"
     printf "\t-p PORT       - The database port for the database        (def. 
${PORT})\n"
@@ -103,6 +103,12 @@
     fi
 }
 
+if [[ ! -n "${USERNAME}" ]]; then
+   usage
+   exit 1
+fi
+
+
 # Install taskcleaner procedures
 psql -w -U ${USERNAME} -h ${SERVERNAME} -p ${PORT} -f ./taskcleaner_sp.sql 
${DATABASE} > /dev/null
 status=$?


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8505ff75d1b22eb27b3aa928d254cc6830b9f4c5
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <emes...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to