summaryrefslogtreecommitdiff
path: root/zuul/ansible/base/callback
diff options
context:
space:
mode:
authorJames E. Blair <jim@acmegating.com>2022-03-30 13:26:56 -0700
committerJames E. Blair <jim@acmegating.com>2022-03-30 13:35:02 -0700
commit08348143f5c438547b3b4b73f6af7ff7e753e013 (patch)
tree6e369de1eb20a4c3345dd308152032aef9b42ab5 /zuul/ansible/base/callback
parentb2c9334efcc506dd7566dab6cce014e46826807e (diff)
downloadzuul-08348143f5c438547b3b4b73f6af7ff7e753e013.tar.gz
Fix module loading for Windows jobs5.2.2
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
Diffstat (limited to 'zuul/ansible/base/callback')
-rw-r--r--zuul/ansible/base/callback/zuul_json.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/zuul/ansible/base/callback/zuul_json.py b/zuul/ansible/base/callback/zuul_json.py
index 6b8b957bb..1d7059871 100644
--- a/zuul/ansible/base/callback/zuul_json.py
+++ b/zuul/ansible/base/callback/zuul_json.py
@@ -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