Defer registration if not ready

This commit is contained in:
Liam Young 2021-10-15 10:15:47 +01:00
parent 3f184a42da
commit 049305546c

View File

@ -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)