From 1d3f2a9a81bce0994ff8b0ec74b964acbb7e2ec9 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 31 Mar 2021 14:49:12 +0200 Subject: [PATCH] * Add changelog * Address reviewer's comments * Add six in requirements.txt Signed-off-by: Alina Buzachis --- changelogs/fragments/405-cachefile_dynamic_client.yml | 4 ++++ plugins/module_utils/common.py | 3 +-- requirements.txt | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/405-cachefile_dynamic_client.yml diff --git a/changelogs/fragments/405-cachefile_dynamic_client.yml b/changelogs/fragments/405-cachefile_dynamic_client.yml new file mode 100644 index 00000000..fda83dc0 --- /dev/null +++ b/changelogs/fragments/405-cachefile_dynamic_client.yml @@ -0,0 +1,4 @@ +--- + minor_changes: + - Add logic for cache file name generation (https://github.com/ansible-collections/community.kubernetes/pull/405). + - Add cache_file when DynamicClient is created (https://github.com/ansible-collections/community.kubernetes/pull/405). \ No newline at end of file diff --git a/plugins/module_utils/common.py b/plugins/module_utils/common.py index 671efc4a..c8df5c4e 100644 --- a/plugins/module_utils/common.py +++ b/plugins/module_utils/common.py @@ -25,7 +25,6 @@ import sys import six import hashlib -import tempfile from datetime import datetime from distutils.version import LooseVersion @@ -225,7 +224,7 @@ def generate_cache_file(configuration): cache_file = generate_cache_file(kubeclient) try: - client = DynamicClient(kubernetes.client.ApiClient(configuration), cache_file) + client = DynamicClient(kubeclient, cache_file) except Exception as err: _raise_or_fail(err, 'Failed to get client due to %s') diff --git a/requirements.txt b/requirements.txt index 6ed70a79..1daabca4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ openshift>=0.6.2 requests-oauthlib +six