Merge branch 'master' of github.com:zalando/patroni into feature/watch-leader-key

This commit is contained in:
Alexander Kukushkin
2015-09-03 10:33:26 +02:00
2 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -354,7 +354,8 @@ primary_conninfo = '{}'
self.query('CREATE ROLE "{0}" WITH LOGIN SUPERUSER PASSWORD %s'.format(
self.superuser['username']), self.superuser['password'])
else:
self.query('ALTER ROLE "{0}" WITH PASSWORD %s'.format(os.environ['USER']), self.superuser['password'])
rolsuper = self.query("""SELECT rolname FROM pg_authid WHERE rolsuper = 't'""").fetchone()[0]
self.query('ALTER ROLE "{0}" WITH PASSWORD %s'.format(rolsuper), self.superuser['password'])
if self.admin:
self.query('CREATE ROLE "{0}" WITH LOGIN CREATEDB CREATEROLE PASSWORD %s'.format(
self.admin['username']), self.admin['password'])
+4 -3
View File
@@ -2,7 +2,7 @@ import os
import time
import unittest
from helpers.utils import sigchld_handler, sigterm_handler, sleep
from helpers.utils import reap_children, sigchld_handler, sigterm_handler, sleep
def nop(*args, **kwargs):
@@ -34,10 +34,11 @@ class TestUtils(unittest.TestCase):
def test_sigterm_handler(self):
self.assertRaises(SystemExit, sigterm_handler, None, None)
def test_sigchld_handler(self):
sigchld_handler(None, None)
def test_reap_children(self):
reap_children()
os.waitpid = os_waitpid
sigchld_handler(None, None)
reap_children()
def test_sleep(self):
time.sleep = time_sleep