From 049305546c046bad93ac6a050f9d37558b555d8e Mon Sep 17 00:00:00 2001 From: Liam Young Date: Fri, 15 Oct 2021 10:15:47 +0100 Subject: [PATCH] Defer registration if not ready --- charms/keystone-k8s/src/charm.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/charms/keystone-k8s/src/charm.py b/charms/keystone-k8s/src/charm.py index d009b2bd..c0509d42 100755 --- a/charms/keystone-k8s/src/charm.py +++ b/charms/keystone-k8s/src/charm.py @@ -179,6 +179,11 @@ class KeystoneOperatorCharm(sunbeam_charm.OSBaseOperatorAPICharm): return _cconfigs def register_service(self, event): + if not self._state.bootstrapped: + event.defer() + return + if not self.unit.is_leader: + return service_domain = self.keystone_manager.create_domain( name='service_domain', may_exist=True)