Commit 201ba118 authored by Jérome Perrin's avatar Jérome Perrin

recipe/postgres: fix python3 support

Since the first version, this have been writing config files in binary
mode, but these are really text files.
parent 89f369e8
...@@ -143,7 +143,7 @@ class Recipe(GenericBaseRecipe): ...@@ -143,7 +143,7 @@ class Recipe(GenericBaseRecipe):
ipv6 = self.options['ipv6'].splitlines() ipv6 = self.options['ipv6'].splitlines()
postgres_conf = os.path.join(pgdata, 'postgresql.conf') postgres_conf = os.path.join(pgdata, 'postgresql.conf')
with open(postgres_conf, 'wb') as cfg: with open(postgres_conf, 'w') as cfg:
cfg.write(textwrap.dedent("""\ cfg.write(textwrap.dedent("""\
listen_addresses = '%s' listen_addresses = '%s'
logging_collector = on logging_collector = on
...@@ -165,7 +165,7 @@ class Recipe(GenericBaseRecipe): ...@@ -165,7 +165,7 @@ class Recipe(GenericBaseRecipe):
))) )))
pg_hba_conf = os.path.join(pgdata, 'pg_hba.conf') pg_hba_conf = os.path.join(pgdata, 'pg_hba.conf')
with open(pg_hba_conf, 'wb') as cfg: with open(pg_hba_conf, 'w') as cfg:
# see http://www.postgresql.org/docs/9.2/static/auth-pg-hba-conf.html # see http://www.postgresql.org/docs/9.2/static/auth-pg-hba-conf.html
cfg_lines = [ cfg_lines = [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment