IPv6 support (#1122)

fixes https://github.com/zalando/patroni/issues/1121
This commit is contained in:
Alexander Kukushkin
2019-08-02 11:34:29 +02:00
committed by GitHub
parent 5cc3afc037
commit 4a24b79b73
9 changed files with 63 additions and 36 deletions
+3 -1
View File
@@ -2,6 +2,7 @@ import datetime
import json
import psycopg2
import unittest
import socket
from mock import Mock, PropertyMock, patch
from patroni.api import RestApiHandler, RestApiServer
@@ -413,7 +414,8 @@ class TestRestApiServer(unittest.TestCase):
srv = MockRestApiServer(lambda a1, a2, a3: None, '')
self.assertRaises(ValueError, srv.reload_config, bad_config)
self.assertRaises(ValueError, srv.reload_config, {})
srv.reload_config({'listen': '127.0.0.2:8008'})
with patch.object(socket.socket, 'setsockopt', Mock(side_effect=socket.error)):
srv.reload_config({'listen': ':8008'})
def test_handle_error(self):
try: