From 6605014eaa4770c3d87599f5b04e175a35a77001 Mon Sep 17 00:00:00 2001 From: Ondra Machacek Date: Fri, 15 Mar 2024 10:06:50 +0100 Subject: [PATCH] Fix folder search filter This PR fixes issue introduced by: https://github.com/ansible-community/ansible.content_builder/pull/79 Params get used wrong brackets. It should use brackets to acces funtion, not array. Signed-off-by: Ondra Machacek --- changelogs/fragments/77-vmware_rest-dont_use_folder.yaml | 2 ++ .../templates/module_directory/vmware_rest/default_module.j2 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/77-vmware_rest-dont_use_folder.yaml diff --git a/changelogs/fragments/77-vmware_rest-dont_use_folder.yaml b/changelogs/fragments/77-vmware_rest-dont_use_folder.yaml new file mode 100644 index 0000000..3701550 --- /dev/null +++ b/changelogs/fragments/77-vmware_rest-dont_use_folder.yaml @@ -0,0 +1,2 @@ +minor_changes: + - "Fix for use folder attribute for host and dc module only" diff --git a/roles/module_openapi_cloud/templates/module_directory/vmware_rest/default_module.j2 b/roles/module_openapi_cloud/templates/module_directory/vmware_rest/default_module.j2 index 7b11fdc..910b5ba 100644 --- a/roles/module_openapi_cloud/templates/module_directory/vmware_rest/default_module.j2 +++ b/roles/module_openapi_cloud/templates/module_directory/vmware_rest/default_module.j2 @@ -85,7 +85,7 @@ async def _{{ operation }}(params, session): {% if name in ["vcenter_host", "vcenter_datacenter"] %} if "folder" not in params: return - search_filter = f"&folders={params.get['folder']}" + search_filter = f"&folders={params.get('folder')}" {% endif %} if "name" not in params: return