MCPcopy Index your code
hub / github.com/kubernetes-client/python / __init__

Method __init__

kubernetes/base/dynamic/discovery.py:43–52  ·  view source on GitHub ↗
(self, client, cache_file)

Source from the content-addressed store, hash-verified

41 """
42
43 def __init__(self, client, cache_file):
44 self.client = client
45 default_cache_id = self.client.configuration.host.encode('utf-8')
46 try:
47 default_cachefile_name = 'osrcp-{0}.json'.format(hashlib.md5(default_cache_id, usedforsecurity=False).hexdigest())
48 except TypeError:
49 # usedforsecurity is only supported in 3.9+
50 default_cachefile_name = 'osrcp-{0}.json'.format(hashlib.md5(default_cache_id).hexdigest())
51 self.__cache_file = cache_file or os.path.join(tempfile.gettempdir(), default_cachefile_name)
52 self.__init_cache()
53
54 def __init_cache(self, refresh=False):
55 if refresh or not os.path.exists(self.__cache_file):

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 2

__init_cacheMethod · 0.95
formatMethod · 0.45

Tested by

no test coverage detected