Alon Bar-Lev has posted comments on this change.

Change subject: core: adding utility for db objects owner change
......................................................................


Patch Set 4:

(2 comments)

please remove the drop fix from this patch... it is not related to it.

....................................................
File packaging/setup/dbutils/changedbowner.sh
Line 17:     -s SERVERNAME - The database servername for the database  (def. 
${SERVERNAME})\n"
Line 18:     -p PORT       - The database port for the database        (def. 
${PORT})\n"
Line 19:     -d DATABASE   - The database name                         (def. 
${DATABASE})\n"
Line 20:     -f FROM_USER  - The current owner for the database             \n"
Line 21:     -f TO_USER    - The new owner for the database             \n"
why trailing spaces? why do we need the quote and new line? Also the should be 
removed?

 usage() {
     cat << __EOF__
Usage: ${ME} ....
bla bla bla
__EOF__

what is ${ME}? shouldn't this be $0 ?
Line 22:     -h            - This help text.\n"
Line 23: __EOF__
Line 24:     exit $ret
Line 25: }


Line 31:         p) PORT=$OPTARG;;
Line 32:         d) DATABASE=$OPTARG;;
Line 33:         f) FROM_USER=$OPTARG;;
Line 34:         t) TO_USER=$OPTARG;;
Line 35:         h) ret=0 && usage;;
oh!

just for you to know...

 ret=0
 ret=1 echo alon
 echo $ret

 will result:
 alon
 0

while:

 myecho() {
     echo alon
 }
 ret=0
 ret=1 myecho
 echo $ret

 will result:
 alon
 1

This is why it is not good to provide env for functions...

but... here you specified global variable (ret), which is also something that 
should be avoided...

I wounder what is the difference between:

 ret=1 && usage

and:

 usage; exit 1
Line 36:        \?) ret=1 && usage;;
Line 37:     esac
Line 38: done
Line 39: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I56c59c0fe749389bd110bcd1a39faae74e71174b
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to