Skip to content

Commit 7446da0

Browse files
committed
Fix checksum parsing for Cirros and Rocky Linux
For Rocky Linux, the checksum file format differs from Ubuntu. The current awk expression failed to extract the correct checksum and would instead output SHA256. This caused checksum validation to fail. A similar issue exists for CirrOS which uses the MD5 algorithm. Changes the logic to first extract the line with the corresponding image name and then searches for a string that looks like a checksum within that line. Closes-Bug: #2081031 Change-Id: Id426db0ad418898a2ebe9f2b5001945520dc6b1d
1 parent a453e2c commit 7446da0

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

playbooks/roles/bifrost-ironic-install/tasks/download_deployment_image.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
mode: "0644"
2828

2929
- name: "Extract deployment image checksum"
30-
command: awk '/{{ deploy_image_upstream_url | basename }}|^[a-z0-9]+$/{print $1}' {{ http_boot_folder }}/{{ deploy_image_filename }}-checksum.CHECKSUMS
30+
shell:
31+
cmd: |
32+
set -o pipefail
33+
grep "{{ deploy_image_upstream_url | basename }}" {{ http_boot_folder }}/{{ deploy_image_filename }}-checksum.CHECKSUMS | grep -owE "[[:xdigit:]]{32,64}"
34+
executable: /bin/bash
3135
register: parsed_deployment_image_checksum
3236
failed_when: parsed_deployment_image_checksum is failed
3337
or not parsed_deployment_image_checksum.stdout
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
Fixes an issue with checksum verification when setting
5+
``upstream_deploy_image_distribution`` to ``rocky`` or
6+
``cirros``.

0 commit comments

Comments
 (0)