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

Load plugin config defs on first load only (fixes #37553) (#37584)

This commit is contained in:
Andrew Gaffney 2018-03-19 12:34:15 -05:00 committed by Brian Coca
parent 3e44186137
commit 0d0bdbec62

View file

@ -348,9 +348,6 @@ class PluginLoader:
def _update_object(self, obj, name, path):
# load plugin config data
self._load_config_defs(name, path)
# set extra info on the module, in case we want it later
setattr(obj, '_original_path', path)
setattr(obj, '_load_name', name)
@ -394,6 +391,10 @@ class PluginLoader:
return None
raise
# load plugin config data
if not found_in_cache:
self._load_config_defs(name, path)
self._update_object(obj, name, path)
return obj
@ -467,6 +468,10 @@ class PluginLoader:
except TypeError as e:
display.warning("Skipping plugin (%s) as it seems to be incomplete: %s" % (path, to_text(e)))
# load plugin config data
if not found_in_cache:
self._load_config_defs(name, path)
self._update_object(obj, name, path)
yield obj