mirror of https://github.com/ansible/ansible.git
Check sys.modules before loading modules
Code for a plugin is usually loaded by a PluginLoader(), and henceforth available from self._module_cache, which prevents duplicate loading. However there are situations (e.g. where one action plugin imports code from another one) where the plugin module might be already imported (and resident in sys.modules), but not present in the PluginLoader's _module_cache, which causes imp.load_source() to effectively reload the module, overwriting global class declarations and causing subtle latent bugs. Fixes #13110. Fixes #12979.pull/13114/head
parent
d8fb5efa90
commit
54eae4a793
Loading…
Reference in New Issue