Skip to content

Commit 9cf9a01

Browse files
committed
Refactor sapcontrol_results processing to use map for improved readability and structure
1 parent 1922e55 commit 9cf9a01

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/roles/ha_scs/tasks/sapcontrol-config.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,15 @@
5757
{% for res in sapcontrol_results.results %}
5858
- {{ res.sapcontrol_method }}: {{ 'Success' if res.rc == 0 else 'Failed' }}
5959
{% endfor %}
60-
test_case_details_from_test_case: "{{ sapcontrol_results.results
61-
| json_query('[].{
62-
command: cmd,
63-
returnCode: rc,
64-
stdout: stdout_lines,
65-
stderr: stderr_lines}')
60+
test_case_details_from_test_case: "{{
61+
sapcontrol_results.results
62+
| map('dict', {
63+
'command': item.cmd,
64+
'returnCode': item.rc,
65+
'stdout': item.stdout_lines,
66+
'stderr': item.stderr_lines
67+
})
68+
| list
6669
}}"
6770

6871
# /*---------------------------------------------------------------------------

0 commit comments

Comments
 (0)