Skip to content

Commit

Permalink
hash cache name to prevent it from becoming too long
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianvf committed Jan 16, 2019
1 parent ff53e1f commit 7990161
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openshift/dynamic/client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import copy
import json
import base64
import hashlib
import tempfile
from functools import partial
from abc import abstractmethod, abstractproperty
Expand Down Expand Up @@ -581,7 +581,7 @@ def __init__(self, client, cache_file):
default_cache_id = self.client.configuration.host
if six.PY3:
default_cache_id = default_cache_id.encode('utf-8')
default_cachefile_name = 'osrcp-{0}.json'.format(base64.b64encode(default_cache_id).decode('utf-8'))
default_cachefile_name = 'osrcp-{0}.json'.format(hashlib.md5(default_cache_id).hexdigest())
self.__cache_file = cache_file or os.path.join(tempfile.gettempdir(), default_cachefile_name)
self.__init_cache()

Expand Down

0 comments on commit 7990161

Please sign in to comment.