Fix issues with raft traffic encryption (#1919)

and run raft behave tests with encryption enabled.

Using the new `pysyncobj` release allowed us to get rid of a lot of hacks with accessing private properties and methods of the parent class and reduce the size of the `raft.py`.

Close https://github.com/zalando/patroni/issues/1746
This commit is contained in:
Alexander Kukushkin
2021-04-30 11:28:41 +02:00
committed by GitHub
parent 294bb43bf1
commit 99626a07f2
7 changed files with 131 additions and 182 deletions
+13 -6
View File
@@ -22,8 +22,9 @@ AUTHOR_EMAIL = '[email protected], [email protected], alexk
KEYWORDS = 'etcd governor patroni postgresql postgres ha haproxy confd' +\
' zookeeper exhibitor consul streaming replication kubernetes k8s'
EXTRAS_REQUIRE = {'aws': ['boto'], 'etcd': ['python-etcd'], 'etcd3': ['python-etcd'], 'consul': ['python-consul'],
'exhibitor': ['kazoo'], 'zookeeper': ['kazoo'], 'kubernetes': ['ipaddress'], 'raft': ['pysyncobj']}
EXTRAS_REQUIRE = {'aws': ['boto'], 'etcd': ['python-etcd'], 'etcd3': ['python-etcd'],
'consul': ['python-consul'], 'exhibitor': ['kazoo'], 'zookeeper': ['kazoo'],
'kubernetes': ['ipaddress'], 'raft': ['pysyncobj', 'cryptography']}
COVERAGE_XML = True
COVERAGE_HTML = False
@@ -171,10 +172,16 @@ def setup_package(version):
if r == '':
continue
extra = False
for e, v in EXTRAS_REQUIRE.items():
if v and r.startswith(v[0]):
EXTRAS_REQUIRE[e] = [r] if e != 'kubernetes' or sys.version_info < (3, 0, 0) else []
extra = True
for e, deps in EXTRAS_REQUIRE.items():
for i, v in enumerate(deps):
if r.startswith(v):
if e != 'kubernetes' or sys.version_info < (3, 0, 0):
deps[i] = r
else:
deps = []
EXTRAS_REQUIRE[e] = deps
extra = True
break
if not extra:
install_requires.append(r)