Fix bug in the post_bootstrap method() (#1795)

The config.write_pgpass(r) should be called unconditionally, no matter whether the password defined in the config or not.

Close https://github.com/zalando/patroni/issues/1727
This commit is contained in:
Alexander Kukushkin
2020-12-16 17:33:44 +01:00
committed by GitHub
parent 492f755bd5
commit 61bf412ac6
+1 -1
View File
@@ -130,7 +130,7 @@ class Bootstrap(object):
# (pghost empty or the default socket directory) connections coming from the local machine.
r['host'] = 'localhost' # set it to localhost to write into pgpass
env = self._postgresql.config.write_pgpass(r) if 'password' in r else None
env = self._postgresql.config.write_pgpass(r)
env['PGOPTIONS'] = '-c synchronous_commit=local'
try: