Keith Robertson has posted comments on this change. Change subject: packaging: Updated fetching db params from pgpass ......................................................................
Patch Set 2: (1 inline comment) IMO, the use of .pgpass by oVirt is completely wrongheaded and is the source of a great many problems. There is a *better* way to supply the user ID and password to the Postgres family of commands (e.g. pg_dump). IMO, the correct way to supply user, password, port to postgres is through the use of environment variables (see [1]). This will allow us to store the user, password, port, etc. in a file which lends itself to parsing. The way we are parsing .pgpass for the oVirt Postgres information is a complete hack. We should: 1- Store the PG connection information in engine.conf 2- *Shell* based applications that need this connection information and which do not use a *proper* DB driver can set/unset this environment variable prior to using a Postgres command (eg. pg_dump). This is how the SoS Postgres plugin works. [1] http://www.postgresql.org/docs/8.3/static/libpq-envars.html .................................................... File src/__main__.py Line 180: pg_user = 'postgres' Line 181: pg_pass = '12345' Line 182: pg_dbhost = 'localhost' Line 183: pg_dbport = '5432' Line 184: Please make these global variables and use then both here and in the Options. If you notice, these defaults are also the same defaults used in the OptionParser (see line 1050 for an example). Line 185: try: Line 186: self['pg_user'] = self._get_pg_var('admin') or pg_user Line 187: self['pg_pass'] = self._get_pg_var('pass', self['pg_user']) or pg_pass Line 188: self['pg_dbhost'] = self._get_pg_var('host') or pg_dbhost -- To view, visit http://gerrit.ovirt.org/11826 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic28e0d1da86bc1a8c7ba909aad3cd541bab80e36 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-log-collector 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: Keith Robertson <[email protected]> Gerrit-Reviewer: Kiril Nesenko <[email protected]> Gerrit-Reviewer: Ofer Schreiber <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
