Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
* Specify path for the cache_file
Browse files Browse the repository at this point in the history
Signed-off-by: Alina Buzachis <[email protected]>
  • Loading branch information
alinabuzachis committed Mar 31, 2021
1 parent fb44b2b commit 6f842f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/module_utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import os
import traceback
import sys
import tempfile
from datetime import datetime
from distutils.version import LooseVersion

Expand Down Expand Up @@ -217,7 +218,8 @@ def auth_set(*names):

def generate_cache_file(kubeclient):
import hashlib
return 'osrcp-{0}.json'.format(hashlib.sha1(get_default_cache_id(kubeclient)).hexdigest())
cache_file_name = 'k8srcp-{0}.json'.format(hashlib.sha1(get_default_cache_id(kubeclient)).hexdigest())
return os.path.join(tempfile.gettempdir(), cache_file_name)

kubeclient = kubernetes.client.ApiClient(configuration)
cache_file = generate_cache_file(kubeclient)
Expand Down

0 comments on commit 6f842f0

Please sign in to comment.