Fix vmedia network config drive handling

The publisher ID generated by Ironic (using oslo.util) is actualy in lowercase,
hence it will never match publisher ID generated by udevadm (uppercase).
In order to compare these strings without case conflict, we put both in lowercase.

Closes-Bug: #2085355
Change-Id: I501c8b46128de38c634b1c159a40ffb0d7a64f4c
(cherry picked from commit 8a27cf7167)
This commit is contained in:
LALLAU Bertrand
2024-11-05 15:53:04 +01:00
committed by Dmitry Tantsur
parent 2e71ef0f8e
commit 4c30a46a46

View File

@@ -33,7 +33,7 @@ else
# We need to enumerate through the devices, and obtain the
for device in $(lsblk -o PATH,LABEL|grep config-2|cut -f1 -d" "); do
device_id=$(udevadm info --query=property --property=ID_FS_PUBLISHER_ID $device | sed s/ID_FS_PUBLISHER_ID=//)
if [[ "${publisher_id}" == "${device_id}" ]]; then
if [[ "${publisher_id,,}" == "${device_id,,}" ]]; then
# SUCCESS! Valid device! Do it!
echo "Device ${device} matches the ${publisher_id}. Mounting..."
mount -t iso9660 -o ro,mode=0700 "${device}" /mnt/config || true