Skip to content

Commit

Permalink
Small except fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
titilambert committed Sep 1, 2017
1 parent f376a25 commit a703483
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion tuxeatpi_common/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,7 @@ def set_notalive(self, data):

def clear(self):
"""Remove all entries in the registry"""
self.etcd_client.delete(self.root_key, recursive=True)
try:
self.etcd_client.delete(self.root_key, recursive=True)
except etcd.EtcdKeyNotFound:
pass
5 changes: 3 additions & 2 deletions tuxeatpi_common/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import json

import etcd
import aio_etcd

from tuxeatpi_common.etcd_client import get_etcd_client
from tuxeatpi_common.etcd_client import get_aioetcd_client
Expand Down Expand Up @@ -55,7 +56,7 @@ async def read(self, watch=False):
while True:
try:
raw_data = await self.etcd_client.read(self.key, wait=watch)
except etcd.EtcdKeyNotFound:
except aio_etcd.EtcdKeyNotFound:
self.logger.info("Component settings not found, waiting")
await asyncio.sleep(3)
continue
Expand All @@ -77,7 +78,7 @@ async def read_global(self, watch=False):
while True:
try:
raw_data = await self.etcd_client.read(self.global_key, wait=watch)
except etcd.EtcdKeyNotFound:
except aio_etcd.EtcdKeyNotFound:
self.logger.info("Global settings not found, waiting")
await asyncio.sleep(3)
continue
Expand Down

0 comments on commit a703483

Please sign in to comment.