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

Commit 7bc6f0d

Browse files
committed
resolve conflicts
2 parents f3b0647 + e61e05a commit 7bc6f0d

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

run_tests.sh

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ ${PYTHON} -m unittest test_simple
77

88
cd ../..
99
flake8 --ignore=W191,F401,E501,F403 .
10+
11+
cd ../..

testgres/testgres.py

+19-8
Original file line numberDiff line numberDiff line change
@@ -421,24 +421,35 @@ def start(self, params={}):
421421
""" Starts cluster """
422422

423423
if self.use_logging:
424-
tmpfile = tempfile.NamedTemporaryFile(
425-
'w', dir=self.logs_dir, delete=False)
426-
logfile = tmpfile.name
424+
tmpfile = tempfile.NamedTemporaryFile('w', dir=self.logs_dir, delete=False)
425+
log_filename = tmpfile.name
427426

428-
self.logger = log_watch(self.name, logfile)
427+
self.logger = log_watch(self.name, log_filename)
429428
else:
430-
logfile = os.path.join(self.logs_dir, "postgresql.log")
429+
log_filename = os.path.join(self.logs_dir, "postgresql.log")
431430

432431
_params = {
433432
"-D": self.data_dir,
434433
"-w": None,
435-
"-l": logfile,
434+
"-l": log_filename,
436435
}
437436
_params.update(params)
438-
self.pg_ctl("start", _params)
437+
try:
438+
self.pg_ctl("start", _params)
439+
except ClusterException as e:
440+
print("\npg_ctl log:\n----")
441+
print(str(e))
442+
if os.path.exists(log_filename):
443+
print("\npostgresql.log:\n----")
444+
with open(log_filename, 'r') as logfile:
445+
text = logfile.readlines()[-1]
446+
print(text)
447+
else:
448+
print("Log file not found: %s", log_filename)
439449

440-
self.working = True
450+
raise ClusterException("Couldn't start the new node")
441451

452+
self.working = True
442453
return self
443454

444455
def status(self):

0 commit comments

Comments
 (0)