1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Catch exceptions when importing plugins, and display an appropriate warning. Fixes #43237 (#43501)

This commit is contained in:
Matt Martz 2018-07-31 16:00:04 -05:00 committed by GitHub
parent 5f98a5a736
commit fd839d7a67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -486,7 +486,10 @@ class PluginLoader:
continue
if path not in self._module_cache:
module = self._load_module_source(name, path)
try:
module = self._load_module_source(name, path)
except Exception as e:
display.warning("Skipping plugin (%s) as it seems to be invalid: %s" % (path, to_text(e)))
self._module_cache[path] = module
found_in_cache = False