Merge pull request #8 from gnuoy/defer-registration

Defer registration if not ready
This commit is contained in:
Liam Young 2021-10-15 10:16:11 +01:00 committed by GitHub
commit 76e1f56d98

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)