diff --git a/lib/charms/ovn_charm.py b/lib/charms/ovn_charm.py index 78b8b2c..b24cb68 100644 --- a/lib/charms/ovn_charm.py +++ b/lib/charms/ovn_charm.py @@ -593,6 +593,7 @@ def configure_tls(self, certificates_interface=None): tls_object['cert'], tls_object['key'], cn='host') + reactive.set_flag('ovn.certs.changed') break else: ch_core.hookenv.log('No certificate with CN matching hostname ' diff --git a/reactive/ovn_chassis_charm_handlers.py b/reactive/ovn_chassis_charm_handlers.py index 05895c9..166acbd 100644 --- a/reactive/ovn_chassis_charm_handlers.py +++ b/reactive/ovn_chassis_charm_handlers.py @@ -133,7 +133,7 @@ def configure_nrpe(): @reactive.when_none('charm.paused', 'is-update-status-hook') @reactive.when(OVN_CHASSIS_ENABLE_HANDLERS_FLAG, 'ovsdb-subordinate.available', - 'certificates.available') + 'ovn.certs.changed') def provide_chassis_certificates_to_principal(): ovsdb_subordinate = reactive.endpoint_from_flag( 'ovsdb-subordinate.available') @@ -156,4 +156,7 @@ def provide_chassis_certificates_to_principal(): ovn_key.read()) except OSError as e: ch_core.hookenv.log('Unable to provide principal with ' - 'chassis certificates: "{}"'.format(str(e))) + 'chassis certificates: "{}"'.format(str(e)), + level=ch_core.hookenv.WARNING) + + reactive.clear_flag('ovn.certs.changed') diff --git a/unit_tests/test_reactive_ovn_chassis_charm_handlers.py b/unit_tests/test_reactive_ovn_chassis_charm_handlers.py index bf0c50f..8ae92e7 100644 --- a/unit_tests/test_reactive_ovn_chassis_charm_handlers.py +++ b/unit_tests/test_reactive_ovn_chassis_charm_handlers.py @@ -63,7 +63,7 @@ def test_hooks(self): 'provide_chassis_certificates_to_principal': ( handlers.OVN_CHASSIS_ENABLE_HANDLERS_FLAG, 'ovsdb-subordinate.available', - 'certificates.available'), + 'ovn.certs.changed'), }, 'when_none': { 'amqp_connection': ('charm.paused', 'is-update-status-hook'),