Skip to content

Commit

Permalink
Ignore broken cache
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianvf committed Feb 14, 2019
1 parent c1490fa commit 2bd14c3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions openshift/dynamic/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ def __init_cache(self, refresh=False):
self.__cache = {}
refresh = True
else:
with open(self.__cache_file, 'r') as f:
self.__cache = json.load(f, cls=cache_decoder(self))
try:
with open(self.__cache_file, 'r') as f:
self.__cache = json.load(f, cls=cache_decoder(self))
except Exception:
self.__init_cache(refresh=True)
self._load_server_info()
self.__resources.update(self.parse_api_groups())

Expand Down

0 comments on commit 2bd14c3

Please sign in to comment.