Skip to content

Commit

Permalink
remove extra exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hertel committed Nov 27, 2023
1 parent a97f73b commit 0de2af4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/ansible/plugins/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,7 @@ def __init__(self, class_name, package, config, subdir, aliases=None, required_b
self._module_cache = MODULE_CACHE[class_name]
self._paths = PATH_CACHE[class_name]
self._plugin_path_cache = PLUGIN_PATH_CACHE[class_name]
try:
self._plugin_instance_cache = OrderedDict() if self.type == 'vars' else None
except ValueError:
self._plugin_instance_cache = None
self._plugin_instance_cache = OrderedDict() if self.subdir == 'vars' else None

self._searched_paths = set()

Expand All @@ -265,7 +262,7 @@ def _clear_caches(self):
self._module_cache = MODULE_CACHE[self.class_name]
self._paths = PATH_CACHE[self.class_name]
self._plugin_path_cache = PLUGIN_PATH_CACHE[self.class_name]
self._plugin_instance_cache = OrderedDict() if self.type == 'vars' else None
self._plugin_instance_cache = OrderedDict() if self.subdir == 'vars' else None
self._searched_paths = set()

def __setstate__(self, data):
Expand Down

0 comments on commit 0de2af4

Please sign in to comment.