diff --git a/lib/charms/opensearch/v0/opensearch_base_charm.py b/lib/charms/opensearch/v0/opensearch_base_charm.py index 19279c005..65a1402f2 100644 --- a/lib/charms/opensearch/v0/opensearch_base_charm.py +++ b/lib/charms/opensearch/v0/opensearch_base_charm.py @@ -859,6 +859,10 @@ def on_tls_conf_set( if self.tls.is_fully_configured(): try: self.tls.reload_tls_certificates() + except OpenSearchHttpError: + logger.error("Could not reload TLS certificates via API, will restart.") + self._restart_opensearch_event.emit() + else: self.status.clear(TLSNotFullyConfigured) self.tls.reset_ca_rotation_state() # if all certs are stored and CA rotation is complete in the cluster @@ -870,10 +874,6 @@ def on_tls_conf_set( logger.info("on_tls_conf_set: Detected CA rotation complete in cluster") self.tls.on_ca_certs_rotation_complete() - except OpenSearchHttpError: - logger.error("Could not reload TLS certificates via API, will restart.") - self._restart_opensearch_event.emit() - else: event.defer() return