Skip to content

Commit

Permalink
Merge pull request #589 from Checkmk/fix/571-folder-lookup-plugin-title
Browse files Browse the repository at this point in the history
Fix folder lookup plugin title
  • Loading branch information
robin-checkmk authored May 24, 2024
2 parents 89e2007 + 2f85213 commit 2d8b5b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/lookup_folder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- Folder lookup module - Return the complete folder information, not only the extensions.
2 changes: 1 addition & 1 deletion plugins/lookup/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,6 @@ def run(self, terms, variables, **kwargs):
response.get("msg", ""),
)
)
ret.append(response.get("extensions"))
ret.append(response)

return ret
12 changes: 6 additions & 6 deletions tests/integration/targets/lookup_folder/tasks/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Get attributes of folder."
ansible.builtin.debug:
msg: "Criticality of {{ checkmk_folder.name }} is {{ extensions.attributes.tag_criticality }}"
msg: "Criticality of {{ checkmk_folder.name }} is {{ folder.extensions.attributes.tag_criticality }}"
vars:
extensions: "{{ lookup('checkmk.general.folder',
folder: "{{ lookup('checkmk.general.folder',
checkmk_folder.path,
server_url=checkmk_var_server_url,
site=outer_item.site,
Expand All @@ -45,9 +45,9 @@

- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Verify folder criticality."
ansible.builtin.assert:
that: "extensions.attributes.tag_criticality == checkmk_folder.criticality"
that: "folder.extensions.attributes.tag_criticality == checkmk_folder.criticality"
vars:
extensions: "{{ lookup('checkmk.general.folder',
folder: "{{ lookup('checkmk.general.folder',
checkmk_folder.path,
server_url=checkmk_var_server_url,
site=outer_item.site,
Expand All @@ -60,9 +60,9 @@

- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Use variables outside the module call."
ansible.builtin.assert:
that: "extensions.attributes.tag_criticality == checkmk_folder.criticality"
that: "folder.extensions.attributes.tag_criticality == checkmk_folder.criticality"
vars:
extensions: "{{ lookup('checkmk.general.folder', checkmk_folder.path) }}"
folder: "{{ lookup('checkmk.general.folder', checkmk_folder.path) }}"
delegate_to: localhost
run_once: true # noqa run-once[task]
when: outer_item.edition == "stable_cee"

0 comments on commit 2d8b5b9

Please sign in to comment.