mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #33591 from techhat/clouderror
Log if the cache hits an error, but don't stop working
This commit is contained in:
commit
c5b3cf6b05
@ -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 = {}
|
||||||
item_list = fun(**kwargs)
|
try:
|
||||||
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user