Alon Bar-Lev has posted comments on this change.
Change subject: packaging: updated handling of pgpass file between versions
......................................................................
Patch Set 6: (4 inline comments)
....................................................
File packaging/fedora/setup/common_utils.py
Line 373: if failOnError and proc.returncode != 0:
Line 374: raise Exception(msg)
Line 375: return ("".join(output.splitlines(True)), proc.returncode)
Line 376:
Line 377: def execSqlCommand(userName, dbName, sqlQuery, failOnError=False,
errMsg=output_messages.ERR_SQL_CODE, envDict=None):
I think we removed this function.
Line 378: logging.debug("running sql query \'%s\' on db." % sqlQuery)
Line 379: cmd = [
Line 380: basedefs.EXEC_PSQL,
Line 381: "-U", userName,
Line 394: "-U", userName,
Line 395: "-d", dbName,
Line 396: "-c", sqlQuery,
Line 397: ]
Line 398: return execCmd(cmdList=cmd, failOnError=failOnError, msg=errMsg,
envDict=envDict)
Why not get the pgpass here? why do we need the environment to be passed to
this function?
Line 399:
Line 400: def parseRemoteSqlCommand(userName, dbHost, dbPort, dbName, sqlQuery,
failOnError=False, errMsg=output_messages.ERR_SQL_CODE):
Line 401: ret = []
Line 402: sqlQuery = "copy (%s) to stdout with csv header;" %
sqlQuery.replace(";", "")
Line 668: return False
Line 669:
Line 670: inDbAdminSection = False
Line 671: inDbUserSection = False
Line 672: for pfile in (basedefs.DB_PASS_FILE, basedefs.ORIG_PASS_FILE):
Why can't we expect one file?
Line 673: if os.path.exists(pfile):
Line 674: logging.debug("found existing pgpass file %s, fetching DB
%s value", pfile, param)
Line 675: with open(pfile, 'r') as pgPassFile:
Line 676: for line in pgPassFile:
....................................................
File packaging/fedora/setup/engine-upgrade.py
Line 766: def unsupportedVersionsPresent(oldversion=UNSUPPORTED_VERSION):
Line 767: """ Check whether there are UNSUPPORTED_VERSION
Line 768: objects present. If yes, throw an Exception
Line 769: """
Line 770: env = utils.getPgPassEnv()
This can go into the execXXXSqlXXXX
Line 771: queryCheckDCVersions="SELECT compatibility_version FROM
storage_pool;"
Line 772: dcVersions, rc = utils.execRemoteSqlCommand(
Line 773: userName=SERVER_ADMIN,
Line 774: dbHost=SERVER_NAME,
--
To view, visit http://gerrit.ovirt.org/8135
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1d44297725d7270982e8724e4aeefda8bc7a88e2
Gerrit-PatchSet: 6
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: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Kiril Nesenko <[email protected]>
Gerrit-Reviewer: Moran Goldboim <[email protected]>
Gerrit-Reviewer: Ofer Schreiber <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches