Skip to content

Commit

Permalink
Ignore consul members in status left in the consul health checks
Browse files Browse the repository at this point in the history
Don't fail the consul health check if there are nodes in status left
  • Loading branch information
d-kuhn committed May 24, 2023
1 parent 9e91cb5 commit 3cfbb0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion rebootmgr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ def check_consul_cluster(con, ignore_failed_checks: bool) -> None:
LOG.warning("All consul cluster checks are ignored.")
else:
for member in con.agent.members():
if "Status" in member.keys() and member["Status"] != 1 and member["Name"] not in whitelist:
# Consul member status 1 = Alive, 3 = Left
if "Status" in member.keys() and member["Status"] not in [1, 3] and member["Name"] not in whitelist:
LOG.error("Consul cluster not healthy: Node %s failed. Exit" % member["Name"])
sys.exit(EXIT_CONSUL_NODE_FAILED)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="rebootmgr",
version="0.0.26",
version="0.0.27",
packages=find_packages(),
include_package_data=True,
install_requires=[
Expand Down

0 comments on commit 3cfbb0a

Please sign in to comment.