Alon Bar-Lev has posted comments on this change.
Change subject: packaging: Added generic DB validations before the upgrade
......................................................................
Patch Set 15: (3 inline comments)
....................................................
File backend/manager/tools/dbutils/fkvalidator.sh
Line 57: local fix_it=${1}
Line 58: if [ "${fix_it}" = "true" ]; then
Line 59: CMD="copy (select fk_violation from fn_db_validate_fks(true))
to stdout;"
Line 60: else
Line 61: CMD="copy (select fk_violation,fk_status from
fn_db_validate_fks(true) where fk_status=1) to stdout with csv;"
Are you sure this should be 'true' here?
Line 62: fi
Line 63: res="$(psql -w --pset=tuples_only=on --set ON_ERROR_STOP=1 -U
${USERNAME} -c "${CMD}" -h "${SERVERNAME}" -p "${PORT}" "${DATABASE}")"
Line 64: exit_code=$?
Line 65:
Line 62: fi
Line 63: res="$(psql -w --pset=tuples_only=on --set ON_ERROR_STOP=1 -U
${USERNAME} -c "${CMD}" -h "${SERVERNAME}" -p "${PORT}" "${DATABASE}")"
Line 64: exit_code=$?
Line 65:
Line 66: out="$(echo "${res}" | cut -f1 -d,)"
BTW: Not sure what will happen if message will contain ','?
Line 67: if [ "${exit_code}" = "0" ]; then
Line 68: exit_code="$(echo "${res}" | cut -f2 -d, | head -1)"
Line 69: fi
Line 70: echo "${out}"
Line 64: exit_code=$?
Line 65:
Line 66: out="$(echo "${res}" | cut -f1 -d,)"
Line 67: if [ "${exit_code}" = "0" ]; then
Line 68: exit_code="$(echo "${res}" | cut -f2 -d, | head -1)"
Why just not set rc=1 if there is any line?
Line 69: fi
Line 70: echo "${out}"
Line 71: exit ${exit_code}
Line 72: }
--
To view, visit http://gerrit.ovirt.org/12512
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ief0e65231bb42b569734cdd2fa6491b645491f98
Gerrit-PatchSet: 15
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Moran Goldboim <[email protected]>
Gerrit-Reviewer: Ofer Schreiber <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches