-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RHELC-1605] Add collecting of post-conversion report
Add collecting of the post-conversion report is possible because in convert2rhel was added new feature enabling this. Remember that post-conversion report is generated only if the analysis step is successful, otherwise only the pre-conversion report is generated.
- Loading branch information
Showing
20 changed files
with
159 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
molecule | ||
molecule==24.2.1 | ||
molecule-plugins[vagrant] | ||
ansible-lint | ||
ansible-core==2.16.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Handle C2R Report | ||
================ | ||
|
||
This role is designed to handle the Convert2RHEL (C2R) report. It extracts relevant information and prepares it for further analysis or conversion tasks. | ||
|
||
### Process of handling: | ||
The handling is divided into two parts based on which activity is being done. | ||
- When the analysis is executed, check for exitense and then parse is required only for the pre-conversion report. | ||
- For convert checking if post-conversion report is available is needed because the report can miss in situation | ||
when the conversion process fails in the analysis part. In that moment, only the pre-conversion report is generated. | ||
|
||
Those actions are controlled by fact `activity` which must be set in the different role related to the activity. | ||
The rest of the actions use fact `handle_c2r_report_result_filename_txt` and `handle_c2r_report_result_filename_json` | ||
for checking and parsing the right places. | ||
|
||
Dependencies | ||
------------ | ||
|
||
This role is a dependency for the `analysis` and `convert` roles. It also depend on them as setting `activity` fact is | ||
needed. | ||
|
||
License | ||
------- | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
# defaults file for handle_c2r_report | ||
|
||
handle_c2r_report_analysis_result_filename_prefix: /var/log/convert2rhel/convert2rhel-pre-conversion | ||
handle_c2r_report_analysis_result_filename_txt: "{{ handle_c2r_report_analysis_result_filename_prefix }}.txt" | ||
handle_c2r_report_analysis_result_filename_json: "{{ handle_c2r_report_analysis_result_filename_prefix }}.json" | ||
|
||
handle_c2r_report_convert_result_filename_prefix: /var/log/convert2rhel/convert2rhel-post-conversion | ||
handle_c2r_report_convert_result_filename_txt: "{{ handle_c2r_report_convert_result_filename_prefix }}.txt" | ||
handle_c2r_report_convert_result_filename_json: "{{ handle_c2r_report_convert_result_filename_prefix }}.json" | ||
... |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
- name: Result file status | ||
ansible.builtin.stat: | ||
path: "{{ handle_c2r_report_result_filename_txt }}" | ||
register: result | ||
- name: Print the value of a variable with message | ||
ansible.builtin.debug: | ||
msg: "The value of my_variable is: {{ handle_c2r_report_result_filename_txt }}" | ||
- name: Set variable | ||
ansible.builtin.set_fact: | ||
result_file_exists: result.stat.exists | ||
- name: Check that result file exists | ||
ansible.builtin.assert: | ||
that: result.stat.exists | ||
msg: "The analysis report file {{ handle_c2r_report_result_filename_txt }} was not created." | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
- name: Handle analysis report | ||
when: activity == "analysis" | ||
block: | ||
- name: Set needed filepath | ||
ansible.builtin.set_fact: | ||
handle_c2r_report_result_filename_txt: "{{ handle_c2r_report_analysis_result_filename_txt }}" | ||
handle_c2r_report_result_filename_json: "{{ handle_c2r_report_analysis_result_filename_json }}" | ||
- name: Include check-results-file.yml | ||
ansible.builtin.include_tasks: check-results-file.yml | ||
- name: Include the parse-c2r-report.yml task to check if conversion inhibited | ||
ansible.builtin.include_tasks: parse-c2r-report.yml | ||
|
||
- name: Handle convert report | ||
when: activity == "convert" | ||
block: | ||
- name: Check if post-conversion report is available | ||
ansible.builtin.stat: | ||
path: "{{ handle_c2r_report_convert_result_filename_txt }}" | ||
register: post_conversion_file | ||
- name: Handle the post-conversion report exists situation | ||
when: post_conversion_file.stat.exists | ||
block: | ||
- name: Set filepath to post-conversion report | ||
ansible.builtin.set_fact: | ||
handle_c2r_report_result_filename_txt: "{{ handle_c2r_report_convert_result_filename_txt }}" | ||
handle_c2r_report_result_filename_json: "{{ handle_c2r_report_convert_result_filename_json }}" | ||
- name: Include check-results-file.yml | ||
ansible.builtin.include_tasks: check-results-file.yml | ||
- name: Handle conversion report | ||
ansible.builtin.include_tasks: parse-c2r-report.yml | ||
- name: Handle the post-conversion report doesn't exist situation | ||
when: not post_conversion_file.stat.exists | ||
block: | ||
# When the post-conversion report isn't available, the pre-conversion report is | ||
# Conversion probably failed in analysis step | ||
- name: Set filepath to pre-conversion report | ||
ansible.builtin.set_fact: | ||
handle_c2r_report_result_filename_txt: "{{ handle_c2r_report_analysis_result_filename_txt }}" | ||
handle_c2r_report_result_filename_json: "{{ handle_c2r_report_analysis_result_filename_json }}" | ||
- name: Include check-results-file.yml | ||
ansible.builtin.include_tasks: check-results-file.yml | ||
- name: Handle analysis report | ||
ansible.builtin.include_tasks: parse-c2r-report.yml | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.