Allow to not have keys in etcd

This commit is contained in:
Nico Schottelius 2019-12-31 13:50:56 +01:00
parent 71c3f9d978
commit 9662e02eb7
1 changed files with 7 additions and 1 deletions

View File

@ -115,7 +115,13 @@ class Settings(object):
)
def __getitem__(self, key):
self.read_values_from_etcd()
# Allow failing to read from etcd if we have
# it locally
try:
self.read_values_from_etcd()
except KeyError as e:
pass
return self.config_parser[key]