From 6f842f01a117a19b8762b9a80a4b456fe786d7cf Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 31 Mar 2021 16:21:24 +0200 Subject: [PATCH] * Specify path for the cache_file Signed-off-by: Alina Buzachis --- plugins/module_utils/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/module_utils/common.py b/plugins/module_utils/common.py index 771c7304..8d2f4f30 100644 --- a/plugins/module_utils/common.py +++ b/plugins/module_utils/common.py @@ -23,6 +23,7 @@ import os import traceback import sys +import tempfile from datetime import datetime from distutils.version import LooseVersion @@ -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)