Skip to content

Commit

Permalink
Compatibility fixes (#1616)
Browse files Browse the repository at this point in the history
* socket.TCP_KEEP* are not defined on windows, macosx, and *bsd
* add [secure] extra to urllib3 for better handling of ip/host checks
  • Loading branch information
CyberDem0n committed Jul 21, 2020
1 parent a68692a commit 38f5f46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions patroni/utils.py
Expand Up @@ -488,9 +488,9 @@ def keepalive_socket_options(timeout, idle, cnt=3):

if sys.platform.startswith('linux'):
yield (socket.SOL_TCP, 18, int(timeout * 1000)) # TCP_USER_TIMEOUT
TCP_KEEPIDLE = socket.TCP_KEEPIDLE
TCP_KEEPINTVL = socket.TCP_KEEPINTVL
TCP_KEEPCNT = socket.TCP_KEEPCNT
TCP_KEEPIDLE = getattr(socket, 'TCP_KEEPIDLE', None)
TCP_KEEPINTVL = getattr(socket, 'TCP_KEEPINTVL', None)
TCP_KEEPCNT = getattr(socket, 'TCP_KEEPCNT', None)
elif sys.platform.startswith('darwin'):
TCP_KEEPIDLE = 0x10 # (named "TCP_KEEPALIVE" in C)
TCP_KEEPINTVL = 0x101
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
@@ -1,4 +1,4 @@
urllib3>=1.19.1,!=1.21
urllib3[secure]>=1.19.1,!=1.21
boto
PyYAML
six >= 1.7
Expand Down

0 comments on commit 38f5f46

Please sign in to comment.