Skip to content

Commit 6e182b5

Browse files
author
James William Pye
committed
Minor modifications.
It's still broken, but remove the genport function as there is a better one in the Python package..
1 parent e11aa15 commit 6e182b5

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

postgresql/bin/pg_tin.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
pg_tin provides a means to manage a set of test clusters.
77
88
This script is used to manage the set of test clusters normally managed in
9-
"~/.pg_tin". It's purpose is to provide simple and quick access to a PostgreSQL
10-
database of a given version or configuration.
9+
"~/.pg_tin". It's purpose is to provide simple and **quick** access to a
10+
PostgreSQL database of a given version or configuration.
1111
"""
1212
import sys
1313
import os
@@ -24,16 +24,6 @@
2424

2525
import optparse
2626

27-
# FIXME: This should check if it can bind the port as well.
28-
def genport(exceptions = (), limit = 100):
29-
port = 0
30-
exceptions = (port,) + tuple(exceptions)
31-
while port in exceptions and limit:
32-
limit -= 1
33-
# Get a random a port from 5433 to 55433
34-
port = int(random() * 50000) + 5433
35-
return port
36-
3727
class Cup(object):
3828
'The cup of clusters.'
3929
def __init__(self, path, parallels = 0):
@@ -82,7 +72,7 @@ def add(self, pg_config_path, **kw):
8272
high = num
8373
ddirpath = os.path.join(self.path, 'cluster_%d' %(high + 1,))
8474

85-
kw['superusername'] = 'tinman'
75+
kw['user'] = 'tinman'
8676
if not kw.has_key('logfile'):
8777
kw['logfile'] = sys.stderr
8878
clust = Cluster(ddirpath, pg_config_data = conf)

0 commit comments

Comments
 (0)