From d592d6afe2d3a7170e3ebc11e17a2da2b5cecf17 Mon Sep 17 00:00:00 2001 From: Pedro Guimaraes Date: Tue, 11 Jun 2024 19:32:44 +0200 Subject: [PATCH] Fix test_charms --- lib/charms/opensearch/v0/constants_charm.py | 1 - lib/charms/opensearch/v0/opensearch_base_charm.py | 11 ++--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/charms/opensearch/v0/constants_charm.py b/lib/charms/opensearch/v0/constants_charm.py index 4b852daef3..d3bd25c9c4 100644 --- a/lib/charms/opensearch/v0/constants_charm.py +++ b/lib/charms/opensearch/v0/constants_charm.py @@ -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..." diff --git a/lib/charms/opensearch/v0/opensearch_base_charm.py b/lib/charms/opensearch/v0/opensearch_base_charm.py index 08533cf2c7..bb466e1925 100644 --- a/lib/charms/opensearch/v0/opensearch_base_charm.py +++ b/lib/charms/opensearch/v0/opensearch_base_charm.py @@ -26,7 +26,6 @@ OpenSearchUsers, PeerRelationName, PluginConfigChangeError, - PluginConfigCheck, RequestUnitServiceOps, SecurityIndexInitProgress, ServiceIsStopping, @@ -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):