Skip to content

Commit

Permalink
🐛 HAProxy errors completed
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammed Hussein Karimi <info@karimi.dev>
  • Loading branch information
mhkarimi1383 committed Oct 30, 2024
1 parent 31265b7 commit ebbd2e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 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.4
appVersion: "0.0.2"
version: 0.0.5
appVersion: "0.0.3"

4 changes: 3 additions & 1 deletion haproxy_redis_sentinel/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class HAProxyOutput(StrEnum):
SERVER_REGISTERED = "New server registered."
SERVER_DELETED = "Server deleted."
SERVER_NOT_FOUND = "No such server."
BACKEND_NOT_FOUND = 'No such backend.'


@app.command()
Expand Down Expand Up @@ -105,7 +106,8 @@ def run(
out = send_command(haproxy_socket, f"del server {
haproxy_backend}/{haproxy_server_name}")
if out not in {HAProxyOutput.SERVER_DELETED,
HAProxyOutput.SERVER_NOT_FOUND}:
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 Down

0 comments on commit ebbd2e6

Please sign in to comment.