Description
Ansible Role
sap_install_media_detect
OS Family
N/A
Ansible Controller - Python version
python --version
Python 3.11.13
Ansible-core version
ansible --version
ansible [core 2.16.14]
Bug Description
Issue
The sapfile
Bash script was updated in the commit 63f1e74. However, since the exit;
statement was removed from the sap_export_nwas_java
detection block, the detection logic for S/4HANA Java files (sap_export_nwas_java
) is no longer properly handled.
Problem
The Bash script continues processing past the sap_export_nwas_java
detection and ends up matching the regular expression /EXP[0-9]/
, which is intended for identifying sap_export_ecc_ides
files. This results in an incorrect match, where sap_export_ecc_ides
logic is applied to files related to S/4HANA Java, like in the following example:
zipinfo -1 51057035.ZIP | awk '/EXP[0-9]/'
DATA_UNITS/EHS_EXPERT_SERVER/EHSEXP32_59.EXE
Solution
To resolve this, I propose updating the awk regex /EXP[0-9]/
to be more restrictive and prevent it from matching unintended cases. Specifically, the regex should be modified to differentiate between sap_export_ecc_ides
and sap_export_nwas_java
more accurately.
Bug reproduction
- Download the DATA_UNITS for SAP S/4HANA JAVA (Software Center > INSTALLATIONS & UPGRADES > By Alphabetical Index (A-Z) > S > SAP S/4HANA > choose the version > INSTALLATION AND UPGRADE > 5XXXXX.ZIP)
- Run the command
zipinfo -1 5XXXXX.ZIP | awk '/EXP[0-9]/'
Community participation
Happy to implement this bug fix