Alon Bar-Lev has uploaded a new change for review.

Change subject: packaging: setup: clear PGPASSWORD when interacting with 
database
......................................................................

packaging: setup: clear PGPASSWORD when interacting with database

when both PGPASSWORD and PGPASSFILE are specified the PGPASSWORD takes
precedence, so we should unset/zero it to avoid errors when user has
PGPASSWORD within environment and executes setup.

Change-Id: Ie02939fe51eb4308d76a65e9eb1eb86df4a6801c
Signed-off-by: Alon Bar-Lev <alo...@redhat.com>
---
M packaging/dbscripts/dbcustomfunctions.sh
M packaging/setup/ovirt_engine_setup/database.py
2 files changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/71/18771/1

diff --git a/packaging/dbscripts/dbcustomfunctions.sh 
b/packaging/dbscripts/dbcustomfunctions.sh
index d6b3aba..116ac82 100755
--- a/packaging/dbscripts/dbcustomfunctions.sh
+++ b/packaging/dbscripts/dbcustomfunctions.sh
@@ -23,6 +23,7 @@
 
     if [ -n "${ENGINE_PGPASS}" ]; then
         export PGPASSFILE="${ENGINE_PGPASS}"
+        unset PGPASSWORD
     else
         export PGPASSFILE="/etc/ovirt-engine/.pgpass"
         if [ ! -r "${PGPASSFILE}" ]; then
diff --git a/packaging/setup/ovirt_engine_setup/database.py 
b/packaging/setup/ovirt_engine_setup/database.py
index 80c683e..dc00b1f 100644
--- a/packaging/setup/ovirt_engine_setup/database.py
+++ b/packaging/setup/ovirt_engine_setup/database.py
@@ -487,6 +487,7 @@
                 self.environment[osetupcons.DBEnv.DATABASE],
             ),
             envAppend={
+                'PGPASSWORD': '',
                 'PGPASSFILE': self.environment[
                     osetupcons.DBEnv.PGPASS_FILE
                 ]
@@ -510,6 +511,7 @@
                 '-f', backupFile,
             ),
             envAppend={
+                'PGPASSWORD': '',
                 'PGPASSFILE': self.environment[
                     osetupcons.DBEnv.PGPASS_FILE
                 ]


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie02939fe51eb4308d76a65e9eb1eb86df4a6801c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to