Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f90dce6

Browse files
committed
fix various warnings
1 parent e03322e commit f90dce6

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.pyc
22
dist
33
tags
4+
*.egg-info

run_tests.sh

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ set -eux
44

55
# DEBUG port-for
66
cat /proc/sys/net/ipv4/ip_local_port_range
7+
${PYTHON} -c "with open('/proc/sys/net/ipv4/ip_local_port_range') as f: l, h = f.read().split(); print(l); print(h);"
78

89
cd testgres/tests
910
${PYTHON} -m unittest test_simple

testgres/testgres.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import os
2525
import subprocess
2626
import pwd
27-
import tempfile
2827
import shutil
2928
import time
3029
import six
@@ -49,9 +48,9 @@
4948
bound_ports = set()
5049
registered_nodes = []
5150
util_threads = []
51+
base_data_dir = None
5252
tmp_dirs = []
5353
pg_config_data = {}
54-
base_data_dir = None
5554

5655

5756
class ClusterException(Exception):
@@ -87,8 +86,8 @@ def __str__(self):
8786

8887
class LogWriter(threading.Thread):
8988
'''
90-
Helper class to implement reading from postgresql.log and redirect
91-
it python logging
89+
Helper class to implement reading from postgresql.log
90+
and redirect it python logging
9291
'''
9392

9493
def __init__(self, node_name, fd):
@@ -328,8 +327,6 @@ def init(self, allows_streaming=False, initdb_params=[]):
328327
"log_statement = all\n"
329328
"port = {}\n".format(self.port))
330329
conf.write(
331-
# "unix_socket_directories = '%s'\n"
332-
# "listen_addresses = ''\n";)
333330
"listen_addresses = '{}'\n".format(self.host))
334331

335332
if allows_streaming:
@@ -451,7 +448,8 @@ def status(self):
451448
If there is no data in data_dir or data_dir do not exists - return None
452449
"""
453450
try:
454-
res = subprocess.check_output([
451+
# TODO: use result?
452+
subprocess.check_output([
455453
self.get_bin_path("pg_ctl"), 'status', '-D',
456454
'{0}'.format(self.data_dir)
457455
])
@@ -732,6 +730,9 @@ def get_new_node(name, base_dir=None, use_logging=False):
732730

733731
def clean_all():
734732
global registered_nodes
733+
global base_data_dir
734+
global tmp_dirs
735+
735736
for node in registered_nodes:
736737
node.cleanup()
737738

0 commit comments

Comments
 (0)