Skip to content

Commit

Permalink
🐛 Fix multi output checks
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammed Hussein Karimi <[email protected]>
  • Loading branch information
mhkarimi1383 committed Nov 4, 2024
1 parent 4afa304 commit eaef21b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions charts/haproxy-redis-sentinel/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: haproxy-redis-sentinel
description: A Helm chart for HAProxy with Redis Sentinel
version: 0.0.8
appVersion: "0.0.5"
version: 0.0.9
appVersion: "0.0.6"

8 changes: 4 additions & 4 deletions haproxy_redis_sentinel/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ def run(
f"set server {
haproxy_backend}/{haproxy_server_name} state maint",
f"del server {haproxy_backend}/{haproxy_server_name}"])
if out not in {HAProxyOutput.SERVER_DELETED,
HAProxyOutput.SERVER_NOT_FOUND,
HAProxyOutput.BACKEND_NOT_FOUND}:
if any(item in out for item in {HAProxyOutput.SERVER_DELETED,
HAProxyOutput.SERVER_NOT_FOUND,
HAProxyOutput.BACKEND_NOT_FOUND}):
raise Exception(f"Error while removing old server: {out}")
out = send_command(haproxy_socket,
f"add server {haproxy_backend}/{haproxy_server_name} {address}") # noqa: E501
Expand All @@ -132,7 +132,7 @@ def run(
port = data[4]
info("Master Changed, Terminating clients")
info(send_command(haproxy_socket,
[f"set server {haproxy_backend}/{haproxy_server_name} state maint",
[f"set server {haproxy_backend}/{haproxy_server_name} state maint", # noqa: E501
f"shutdown sessions server {haproxy_backend}/{haproxy_server_name}"])) # noqa: E501
info(f"Switching to new master Host: {host}, Port: {port}")
info(send_command(haproxy_socket,
Expand Down

0 comments on commit eaef21b

Please sign in to comment.