Eli Mesika has posted comments on this change. Change subject: ensure restored engine db objects are owned by engine user ......................................................................
Patch Set 1: (4 inline comments) .................................................... File backend/manager/dbscripts/dbcustomfunctions.sh Line 36: execute_file "create_views.sql" ${DATABASE} ${SERVERNAME} ${PORT} > /dev/null Line 37: execute_file "create_dwh_views.sql" ${DATABASE} ${SERVERNAME} ${PORT} > /dev/null Line 38: } Line 39: Line 40: verify_dbobject_ownership() { name is not accurate please change to fn_db_set_dbobjects_ownership since this function also sets teh ownership Line 41: cmd="select c.relname \ Line 42: from pg_class c join pg_roles r on r.oid = c.relowner join pg_namespace n on n.oid = c.relnamespace \ Line 43: where c.relkind in ('r','v','S') \ Line 44: and n.nspname = 'public' and r.rolname != '${DBOBJECT_OWNER}';" Line 48: echo "Changing ownership of objects in database '$DATABASE' to owner '$DBOBJECT_OWNER' started..." Line 49: for tab in $(echo $res); do Line 50: cmd=${cmd}"alter table $tab owner to ${DBOBJECT_OWNER}; " Line 51: done Line 52: echo $cmd | psql -h $SERVERNAME -p $PORT -U $USERNAME -d $DATABASE --set ON_ERROR_STOP=1 why not using execute_command ??? also , please run the command only if cmd != "" Line 53: echo -n "Changing ownership of objects in database '$DATABASE' to owner '$DBOBJECT_OWNER' " Line 54: if [ $? -eq 0 ]; then Line 55: echo "completed." Line 56: else Line 54: if [ $? -eq 0 ]; then Line 55: echo "completed." Line 56: else Line 57: echo "failed." Line 58: return 1 please remove TWS Line 59: fi Line 60: fi .................................................... File backend/manager/dbscripts/restore.sh Line 83: fi Line 84: Line 85: verify_dbobject_ownership Line 86: if [ $? -ne 0 ]; then Line 87: exit 1 please echo a suitable error message and exit with 2 -- To view, visit http://gerrit.ovirt.org/13377 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f16f66066d9056c97a32f180c02d8bd248d1eac Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Mark Huth <mh...@redhat.com> Gerrit-Reviewer: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Mark Huth <mh...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches