summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSloane Hertel <19572925+s-hertel@users.noreply.github.com>2025-01-14 20:55:33 +0100
committerGitHub <noreply@github.com>2025-01-14 20:55:33 +0100
commitad93b96750fa04e8e14c0a0ea5fd3b2162a312b7 (patch)
treef00481a3a24bd33b7a64d2ef5cb540c19974e4b5
parentuser: Fix homedir permissions when UMASK is unset in /etc/login.defs (diff)
downloadansible-ad93b96750fa04e8e14c0a0ea5fd3b2162a312b7.tar.xz
ansible-ad93b96750fa04e8e14c0a0ea5fd3b2162a312b7.zip
host_group_vars - remove unnecessary os.path.join cache (#84549)
-rw-r--r--lib/ansible/plugins/vars/host_group_vars.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/ansible/plugins/vars/host_group_vars.py b/lib/ansible/plugins/vars/host_group_vars.py
index 7baa76bf28..0446f053d5 100644
--- a/lib/ansible/plugins/vars/host_group_vars.py
+++ b/lib/ansible/plugins/vars/host_group_vars.py
@@ -63,7 +63,6 @@ from ansible.utils.vars import combine_vars
CANONICAL_PATHS = {} # type: dict[str, str]
FOUND = {} # type: dict[str, list[str]]
NAK = set() # type: set[str]
-PATH_CACHE = {} # type: dict[tuple[str, str], str]
class VarsModule(BaseVarsPlugin):
@@ -119,11 +118,7 @@ class VarsModule(BaseVarsPlugin):
else:
raise AnsibleParserError("Supplied entity must be Host or Group, got %s instead" % (type(entity)))
- try:
- opath = PATH_CACHE[(realpath_basedir, subdir)]
- except KeyError:
- opath = PATH_CACHE[(realpath_basedir, subdir)] = os.path.join(realpath_basedir, subdir)
-
+ opath = os.path.join(realpath_basedir, subdir)
key = '%s.%s' % (entity_name, opath)
if cache: