Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 ansible#13110. Fixes ansible#12979.
- Loading branch information