Skip to content

Commit

Permalink
Merge pull request #770 from IBM/list-components-header
Browse files Browse the repository at this point in the history
#769 Supplement header in list-components - HOTFIX
  • Loading branch information
fketelaars authored Aug 30, 2024
2 parents f28030f + a563eae commit 7598a05
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,15 @@
- name: Get column headers
shell: |
head -1 {{ _cp4d_components_file }}
register: _csv_column_headers
register: _csv_column_headers_output

- set_fact:
_csv_column_headers: "{{ _csv_column_headers_output.stdout }}"

- name: Patch column headers if incorrect (CP4D 5.0.2)
set_fact:
_csv_column_headers: "Component name,Description,Is Automatic Dependency,CASE Name,CASE Version,Operator CSV Version,CR API,CR Kind,CR Name,CR Version,Dependencies,Supported Architecture,Support Online Upgrade"
when: not _csv_column_headers is search("Component name")

# Try to copy the list-components output file. In certain situations (Windows, SELinux), the command may fail and has to be re-run without remote_src
- block:
Expand All @@ -99,6 +107,6 @@
- name: Try to convert to json
read_csv:
path: "{{ _cp4d_components_no_header_file }}"
fieldnames: "{{ _csv_column_headers.stdout | replace(' ','_') }}"
fieldnames: "{{ _csv_column_headers | replace(' ','_') }}"
skipinitialspace: True
register: _list_components_json

0 comments on commit 7598a05

Please sign in to comment.