Fix module loading for Windows jobs
The recent security fix that caused loading ansible.bultin.command to load the normal command module was a little too aggressive since the same mechanism is used by Ansible to load Windows powershell support code, which is under the Ansible.ModuleUtils.* hierarchy. This would result in an error from Ansible when attempting to run the setup playbook: Could not find imported module support code for 'Ansible.ModuleUtils.Legacy'"' This is corrected by reducing the scope of the mutation to just ansible.builtin and ansible.legacy. Change-Id: I70e9481478a3326692cb848ce0782f5331dc4758
This commit is contained in:
parent
b2c9334efc
commit
08348143f5
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
fixes:
|
||||
- |
|
||||
An issue introduced in Zuul version 5.2.0 which could cause jobs
|
||||
running on Windows nodes to fail with the error `Could not find
|
||||
imported module support code for 'Ansible.ModuleUtils.Legacy'"`
|
||||
has been corrected.
|
|
@ -220,13 +220,17 @@ orig_find_plugin = PluginLoader.find_plugin
|
|||
|
||||
|
||||
def mp_get(self, name, *args, **kwargs):
|
||||
name = name.rsplit('.', 1)[-1]
|
||||
if (name.startswith('ansible.builtin.') or
|
||||
name.startswith('ansible.legacy.')):
|
||||
name = name.rsplit('.', 1)[-1]
|
||||
ret = orig_get(self, name, *args, **kwargs)
|
||||
return ret
|
||||
|
||||
|
||||
def mp_find_plugin(self, name, *args, **kwargs):
|
||||
name = name.rsplit('.', 1)[-1]
|
||||
if (name.startswith('ansible.builtin.') or
|
||||
name.startswith('ansible.legacy.')):
|
||||
name = name.rsplit('.', 1)[-1]
|
||||
ret = orig_find_plugin(self, name, *args, **kwargs)
|
||||
return ret
|
||||
|
||||
|
|
Loading…
Reference in New Issue