Skip to content

Commit

Permalink
Merge pull request #61 from syseleven/dkuhn-ignore-left-consul-agents
Browse files Browse the repository at this point in the history
Ignore consul members in status left in the consul health checks
  • Loading branch information
d-kuhn authored May 25, 2023
2 parents 9e91cb5 + 3cfbb0a commit f0ebe06
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 f0ebe06

Please sign in to comment.