From ad93b96750fa04e8e14c0a0ea5fd3b2162a312b7 Mon Sep 17 00:00:00 2001 From: Sloane Hertel <19572925+s-hertel@users.noreply.github.com> Date: Tue, 14 Jan 2025 14:55:33 -0500 Subject: [PATCH] host_group_vars - remove unnecessary os.path.join cache (#84549) --- lib/ansible/plugins/vars/host_group_vars.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/ansible/plugins/vars/host_group_vars.py b/lib/ansible/plugins/vars/host_group_vars.py index 7baa76bf28f..0446f053d53 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: