Yedidyah Bar David has posted comments on this change.

Change subject: packaging: Allow restore to different db location
......................................................................


Patch Set 7:

(4 comments)

....................................................
File packaging/bin/engine-backup.sh
Line 122:                               MY_DB_USER="${v}"
Line 123:                       ;;
Line 124:                       --db-passfile=*)
Line 125:                               DB_PASSFILE="${v}"
Line 126:                               if ! [ -r "${DB_PASSFILE}" ]; then
Done
Line 127:                                       die "Can not read password file 
${DB_PASSFILE}"
Line 128:                               fi
Line 129:                               read MY_DB_PASSWORD < "${DB_PASSFILE}"
Line 130:                       ;;


Line 266:               restoreFiles "${BACKUP_PATHS}"
Line 267:       fi
Line 268: 
Line 269:       log "Reloading configuration"
Line 270:       [ -n "${CHANGE_DB_CREDENTIALS}" ] && changeDBConf
Done, details below
Line 271:       load_config
Line 272:       log "Generating pgpass"
Line 273:       generatePgPass # Must run after configuration reload
Line 274:       log "Verifying connection"


Line 328: 
Line 329: setMyDBCredentials() {
Line 330:       local options
Line 331:       [ "${MY_DB_SECURED}" = "True" ] && \
Line 332:               options="${options}ssl=true"
Done
Line 333:       [ "${MY_DB_SECURED_VALIDATION}" != "True" ] && \
Line 334:               
options="${options}&sslfactory=org.postgresql.ssl.NonValidatingFactory"
Line 335: 
Line 336:       MY_DB_CREDS="ENGINE_DB_HOST=${MY_DB_HOST}


Line 342: ENGINE_DB_SECURED_VALIDATION=${MY_DB_SECURED_VALIDATION}
Line 343: ENGINE_DB_DRIVER=org.postgresql.Driver
Line 344: 
ENGINE_DB_URL=jdbc:postgresql://\${ENGINE_DB_HOST}:\${ENGINE_DB_PORT}/\${ENGINE_DB_DATABASE}?${options}
Line 345: "
Line 346:       eval "${MY_DB_CREDS}"
Not sure there is much point in keeping the actual change to after 'success', 
because we already replaced the files by then (and left the system "in the 
middle"), but done anyway. My main intention was to test/alert/exit _before_ 
restoreFiles, so as to keep the system unchanged. In principle this can be done 
also if not using --change-db-credentials, but it was less clean that way (e.g. 
sourcing just the 10-database.conf file), whereas with --change-db-credentials, 
and since you objected to merging with existing credentials, I already know all 
I need before restoreFiles and exit if can't connect.

Anyway, changed as you asked.
Line 347: }
Line 348: 
Line 349: changeDBConf() {
Line 350:       local conf="${ENGINE_ETC}/engine.conf.d/10-setup-database.conf"


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie2c84111808c638a1c589cf3c14c271184a0a7c2
Gerrit-PatchSet: 7
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yedidyah Bar David <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Ofer Schreiber <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Yedidyah Bar David <[email protected]>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to