Commit b0f55c0a authored by Jérome Perrin's avatar Jérome Perrin

recipe/postgres: support non standard port

even though the recipe has a required option for port, it was not used
and server was always listening on default (5432) port
parent 87e7812b
......@@ -147,6 +147,7 @@ class Recipe(GenericBaseRecipe):
with open(postgres_conf, 'w') as cfg:
cfg.write(textwrap.dedent("""\
listen_addresses = '%s'
port = %s
logging_collector = on
log_rotation_size = 50MB
max_connections = 100
......@@ -162,6 +163,7 @@ class Recipe(GenericBaseRecipe):
unix_socket_permissions = 0700
""" % (
','.join(set(ipv4).union(ipv6)),
self.options['port'],
pgdata,
)))
......@@ -215,6 +217,7 @@ class Recipe(GenericBaseRecipe):
p = subprocess.Popen([
psql_binary,
'-h', pgdata,
'-p', self.options['port'],
'-U', user,
'-d', self.options['dbname'],
],
......
......@@ -107,3 +107,6 @@ class PostgresTest(unittest.TestCase):
):
psycopg2.connect(dsn)
class PostgresTestNonStandardPort(PostgresTest):
port = 5433
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