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

(cherry picked from commit 0d0bdbec62)
This commit is contained in:
Andrew Gaffney 2018-03-19 12:34:15 -05:00 committed by Matt Davis
parent 5ea8fa4052
commit 3362ad16b1

View file

@ -347,9 +347,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)
@ -393,6 +390,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
@ -466,6 +467,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