Skip to content

Commit

Permalink
Move status.clear to be at the end of config_changed
Browse files Browse the repository at this point in the history
  • Loading branch information
phvalguima committed Jun 14, 2024
1 parent 8b3f15c commit ec15f2e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/charms/opensearch/v0/opensearch_base_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,13 +656,14 @@ def _on_config_changed(self, event: ConfigChangedEvent): # noqa C901
if self.unit.is_leader() and isinstance(e, OpenSearchPluginError):
self.status.set(BlockedStatus(PluginConfigChangeError), app=True)
event.defer()
return
except OpenSearchKeystoreNotReadyYetError:
logger.warning("Keystore not ready yet")
event.defer()
else:
if self.unit.is_leader():
self.status.clear(PluginConfigChangeError, app=True)
self.status.clear(PluginConfigCheck, new_status=original_status, app=True)

if self.unit.is_leader():
self.status.clear(PluginConfigChangeError, app=True)
self.status.clear(PluginConfigCheck, new_status=original_status, app=True)

def _on_set_password_action(self, event: ActionEvent):
"""Set new admin password from user input or generate if not passed."""
Expand Down

0 comments on commit ec15f2e

Please sign in to comment.