Skip to content

Commit 823b713

Browse files
Tompage1994djdanielsson
authored andcommitted
Improve error handling output for collection uploads.
1 parent 33b9db1 commit 823b713

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
bugfixes:
3+
- Improve error handling output for collection uploads. Now displays path and namespace.

roles/collect_async_status/tasks/handle_error.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,20 @@
8484
ansible.builtin.set_fact:
8585
__cas_job_async_item: "{{ __cas_job_async_item | combine({ 'groups': cas_job_async_results_item[__cas_job_async_item_loop_var]['groups']}) }}"
8686

87+
- name: handle_error | Check item for namespace
88+
when:
89+
- cas_job_async_results_item[__cas_job_async_item_loop_var]["namespace"] is defined
90+
- cas_job_async_results_item[__cas_job_async_item_loop_var]["namespace"] is not none
91+
ansible.builtin.set_fact:
92+
__cas_job_async_item: "{{ __cas_job_async_item | combine({ 'namespace': cas_job_async_results_item[__cas_job_async_item_loop_var]['namespace']}) }}"
93+
94+
- name: handle_error | Check item for path
95+
when:
96+
- cas_job_async_results_item[__cas_job_async_item_loop_var]["path"] is defined
97+
- cas_job_async_results_item[__cas_job_async_item_loop_var]["path"] is not none
98+
ansible.builtin.set_fact:
99+
__cas_job_async_item: "{{ __cas_job_async_item | combine({ 'path': cas_job_async_results_item[__cas_job_async_item_loop_var]['path']}) }}"
100+
87101
- name: handle_error | Build consolidated list of failed objects and the error
88102
ansible.builtin.set_fact:
89103
aap_configuration_role_errors: "{{ aap_configuration_role_errors | default({})
@@ -106,4 +120,6 @@
106120
user: "{{ __cas_job_async_item['user'] | default(omit) }}"
107121
username: "{{ __cas_job_async_item['username'] | default(omit) }}"
108122
groups: "{{ __cas_job_async_item['groups'] | default(omit) }}"
123+
namespace: "{{ __cas_job_async_item['namespace'] | default(omit) }}"
124+
path: "{{ __cas_job_async_item['path'] | default(omit) }}"
109125
...

roles/hub_collection/tasks/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858
cas_job_async_results_item: "{{ __collections_job_async_result_item }}"
5959
cas_error_list_var_name: "hub_collections_errors"
6060
__operation: "{{ operation_translate[__collections_job_async_result_item.__hub_collection_item.state | default(platform_state) | default('present')] }}"
61-
cas_object_label: "{{ __operation.verb }} Collection {{ __collections_job_async_result_item.__hub_collection_item.name }} | Wait for finish the Collection {{ __operation.action }}"
61+
cas_object_label: "{{ __operation.verb }} Collection {{ _collection_object_label }} | Wait for finish the Collection {{ __operation.action }}"
62+
_collection_object_label: "{{ __collections_job_async_result_item.__hub_collection_item.path | default(_collection_backup_label) }}"
63+
_collection_backup_label: "{{ __collections_job_async_result_item.__hub_collection_item.namespace }}.{{ __collections_job_async_result_item.__hub_collection_item.name }}:{{ __collections_job_async_result_item.__hub_collection_item.version | default('') }}"
6264

6365
always:
6466
- name: Cleanup async results files

0 commit comments

Comments
 (0)