Skip to content

Commit 2bd14c3

Browse files
committed
Ignore broken cache
1 parent c1490fa commit 2bd14c3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

openshift/dynamic/client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,11 @@ def __init_cache(self, refresh=False):
112112
self.__cache = {}
113113
refresh = True
114114
else:
115-
with open(self.__cache_file, 'r') as f:
116-
self.__cache = json.load(f, cls=cache_decoder(self))
115+
try:
116+
with open(self.__cache_file, 'r') as f:
117+
self.__cache = json.load(f, cls=cache_decoder(self))
118+
except Exception:
119+
self.__init_cache(refresh=True)
117120
self._load_server_info()
118121
self.__resources.update(self.parse_api_groups())
119122

0 commit comments

Comments
 (0)