Merge pull request #33591 from techhat/clouderror

Log if the cache hits an error, but don't stop working
This commit is contained in:
Thomas S Hatch 2016-05-28 08:55:49 -06:00
commit c5b3cf6b05

View File

@ -221,7 +221,10 @@ def _cache(bank, key, fun, **kwargs):
items = cache.fetch(bank, key) items = cache.fetch(bank, key)
if items is None: if items is None:
items = {} items = {}
try:
item_list = fun(**kwargs) item_list = fun(**kwargs)
except CloudError as exc:
log.warn('There was a cloud error calling {0} with kwargs {1}: {2}'.format(fun, kwargs, exc))
for item in item_list: for item in item_list:
items[item.name] = object_to_dict(item) items[item.name] = object_to_dict(item)
cache.store(bank, key, items) cache.store(bank, key, items)