Skip to content

Commit

Permalink
Clean-up peer_cm status (#291)
Browse files Browse the repository at this point in the history
Co-authored-by: Mehdi Bendriss <[email protected]>
  • Loading branch information
phvalguima and Mehdi-Bendriss authored May 4, 2024
1 parent 093a086 commit 9786ffb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/charms/opensearch/v0/opensearch_base_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def _on_opensearch_data_storage_detaching(self, _: StorageDetachingEvent): # no
# release lock
self.node_lock.release()

def _on_update_status(self, event: UpdateStatusEvent):
def _on_update_status(self, event: UpdateStatusEvent): # noqa: C901
"""On update status event.
We want to periodically check for the following:
Expand Down Expand Up @@ -586,6 +586,10 @@ def _on_update_status(self, event: UpdateStatusEvent):
HealthColors.IGNORE,
]:
event.defer()
else:
deployment_desc = self.opensearch_peer_cm.deployment_desc()
# check if peer status needs to be cleaned
self.opensearch_peer_cm.apply_status_if_needed(deployment_desc)

if health == HealthColors.UNKNOWN:
return
Expand Down

0 comments on commit 9786ffb

Please sign in to comment.