diff --git a/buildman/manager/ephemeral.py b/buildman/manager/ephemeral.py index 701465c3f..aa9bb7193 100644 --- a/buildman/manager/ephemeral.py +++ b/buildman/manager/ephemeral.py @@ -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')