Skip to content

Commit

Permalink
Fix test_charms
Browse files Browse the repository at this point in the history
  • Loading branch information
phvalguima committed Jun 11, 2024
1 parent f580c64 commit d592d6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
1 change: 0 additions & 1 deletion lib/charms/opensearch/v0/constants_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
WaitingForOtherUnitServiceOps = "Waiting for other units to complete the ops on their service."
NewIndexRequested = "new index {index} requested"
RestoreInProgress = "Restore in progress..."
PluginConfigCheck = "Plugin configuration check."
BackupSetupStart = "Backup setup started."
BackupConfigureStart = "Configuring backup service..."
BackupInDisabling = "Disabling backup service..."
Expand Down
11 changes: 2 additions & 9 deletions lib/charms/opensearch/v0/opensearch_base_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
OpenSearchUsers,
PeerRelationName,
PluginConfigChangeError,
PluginConfigCheck,
RequestUnitServiceOps,
SecurityIndexInitProgress,
ServiceIsStopping,
Expand Down Expand Up @@ -641,22 +640,16 @@ def _on_config_changed(self, event: ConfigChangedEvent): # noqa C901
event.defer()
return

if self.unit.is_leader():
self.status.set(MaintenanceStatus(PluginConfigCheck), app=True)

if self.plugin_manager.run() and not restart_requested:
self._restart_opensearch_event.emit()

except (OpenSearchPluginError, OpenSearchKeystoreNotReadyYetError) as e:
if self.unit.is_leader():
self.status.clear(PluginConfigCheck, app=True)
if isinstance(e, OpenSearchPluginError):
self.status.set(BlockedStatus(PluginConfigChangeError), app=True)
if self.unit.is_leader() and isinstance(e, OpenSearchPluginError):
self.status.set(BlockedStatus(PluginConfigChangeError), app=True)
event.defer()
return

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

def _on_set_password_action(self, event: ActionEvent):
Expand Down

0 comments on commit d592d6a

Please sign in to comment.