Alon Bar-Lev has uploaded a new change for review. Change subject: db ......................................................................
db Change-Id: Ifb80c2d57a516112dc54a36b1be868205359862e Signed-off-by: Alon Bar-Lev <[email protected]> --- M packaging/setup/ovirt_engine_setup/database.py M packaging/setup/plugins/ovirt-engine-setup/provisioning/postgres.py 2 files changed, 39 insertions(+), 27 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/01/16101/1 diff --git a/packaging/setup/ovirt_engine_setup/database.py b/packaging/setup/ovirt_engine_setup/database.py index 68e2da7..082c2cc 100644 --- a/packaging/setup/ovirt_engine_setup/database.py +++ b/packaging/setup/ovirt_engine_setup/database.py @@ -126,14 +126,24 @@ connection = self.environment[osetupcons.DBEnv.CONNECTION] else: self.logger.debug('Creating own connection') - _connection = connection = psycopg2.connect( - host=host, - port=port, - user=user, - password=password, - database=database, - sslmode=sslmode, - ) + + # + # old psycopg2 does not know how to ignore + # uselss parameters + # + if not host: + _connection = connection = psycopg2.connect( + database=database, + ) + else: + _connection = connection = psycopg2.connect( + host=host, + port=port, + user=user, + password=password, + database=database, + sslmode=sslmode, + ) if not transaction: old_autocommit = __backup_autocommit(connection) diff --git a/packaging/setup/plugins/ovirt-engine-setup/provisioning/postgres.py b/packaging/setup/plugins/ovirt-engine-setup/provisioning/postgres.py index 6fe194f..269bbee 100644 --- a/packaging/setup/plugins/ovirt-engine-setup/provisioning/postgres.py +++ b/packaging/setup/plugins/ovirt-engine-setup/provisioning/postgres.py @@ -157,7 +157,7 @@ if matcher is not None: line = line.replace( matcher.group('param'), - 'peer', + 'ident', # we cannot use peer <psql-9 ) content.append(line) @@ -182,25 +182,27 @@ # order is important, add after local # so we be first if line.lstrip().startswith('local'): - content.append( - ( - '{host:7} ' - '{user:15} ' - '{database:15} ' - '{address:23} ' - '{auth}' - ).format( - host='host', - user=self.environment[ - osetupcons.DBEnv.USER - ], - database=self.environment[ - osetupcons.DBEnv.DATABASE - ], - address='all', - auth='md5', + # we cannot use all for address <psql-9 + for address in ('0.0.0.0/0', '::0/0'): + content.append( + ( + '{host:7} ' + '{user:15} ' + '{database:15} ' + '{address:23} ' + '{auth}' + ).format( + host='host', + user=self.environment[ + osetupcons.DBEnv.USER + ], + database=self.environment[ + osetupcons.DBEnv.DATABASE + ], + address=address, + auth='md5', + ) ) - ) transaction.append( filetransaction.FileTransaction( -- To view, visit http://gerrit.ovirt.org/16101 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifb80c2d57a516112dc54a36b1be868205359862e Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
