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 <alou...@redhat.com> Gerrit-Reviewer: Alex Lourie <alou...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Moran Goldboim <mgold...@redhat.com> Gerrit-Reviewer: Ofer Schreiber <oschr...@redhat.com> Gerrit-Reviewer: Sandro Bonazzola <sbona...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches