Handle the case where there are no realms registered.
This commit is contained in:
parent
b33ee1a474
commit
320ae63ccd
1 changed files with 8 additions and 4 deletions
|
@ -131,10 +131,14 @@ class EphemeralBuilderManager(BaseManager):
|
|||
|
||||
@coroutine
|
||||
def _register_existing_realms(self):
|
||||
all_realms = yield From(self._etcd_client.read(ETCD_REALM_PREFIX, recursive=True))
|
||||
for realm in all_realms.children:
|
||||
if not realm.dir:
|
||||
self._register_realm(json.loads(realm.value))
|
||||
try:
|
||||
all_realms = yield From(self._etcd_client.read(ETCD_REALM_PREFIX, recursive=True))
|
||||
for realm in all_realms.children:
|
||||
if not realm.dir:
|
||||
self._register_realm(json.loads(realm.value))
|
||||
except KeyError:
|
||||
# no realms have been registered yet
|
||||
pass
|
||||
|
||||
def initialize(self, manager_config):
|
||||
logger.debug('Calling initialize')
|
||||
|
|
Reference in a new issue