|
| 1 | +From 627dee659dccdb3f2e30f0454c7f73caf00705f0 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Doug Goldstein < [email protected]> |
| 3 | +Date: Mon, 24 Nov 2025 15:04:57 -0600 |
| 4 | +Subject: [PATCH] fix: use the correct path to the image when deep image |
| 5 | + inspection is off |
| 6 | + |
| 7 | +When deep image inspection is disabled, the incorrect path was used to |
| 8 | +determine the image format of the file resulting in a no such file or |
| 9 | +directory exception which bubbled up and made it appear as if the cache |
| 10 | +was missing. |
| 11 | + |
| 12 | +Change-Id: Ibaf1486da9510fdad479523159797815e783e5f6 |
| 13 | +Signed-off-by: Doug Goldstein < [email protected]> |
| 14 | +--- |
| 15 | + ironic/common/images.py | 7 ++++--- |
| 16 | + ...bug-disable-deep-image-inspection-bfd44bb8307dea1a.yaml | 7 +++++++ |
| 17 | + 2 files changed, 11 insertions(+), 3 deletions(-) |
| 18 | + create mode 100644 releasenotes/notes/bug-disable-deep-image-inspection-bfd44bb8307dea1a.yaml |
| 19 | + |
| 20 | +diff --git a/ironic/common/images.py b/ironic/common/images.py |
| 21 | +index 7da87828f..60f4a3450 100644 |
| 22 | +--- a/ironic/common/images.py |
| 23 | ++++ b/ironic/common/images.py |
| 24 | +@@ -527,12 +527,13 @@ def image_to_raw(image_href, path, path_tmp): |
| 25 | + 'format': fmt}) |
| 26 | + raise exception.InvalidImage() |
| 27 | + else: |
| 28 | +- fmt = get_source_format(image_href, path) |
| 29 | ++ fmt = get_source_format(image_href, path_tmp) |
| 30 | + LOG.warning("Security: Image safety checking has been disabled. " |
| 31 | + "This is unsafe operation. Attempting to continue " |
| 32 | +- "the detected format %(img_fmt)s for %(path)s.", |
| 33 | ++ "with the detected format %(img_fmt)s for " |
| 34 | ++ "image %(image_href)s.", |
| 35 | + {'img_fmt': fmt, |
| 36 | +- 'path': path}) |
| 37 | ++ 'image_href': image_href}) |
| 38 | + |
| 39 | + if fmt not in RAW_IMAGE_FORMATS and fmt != "iso": |
| 40 | + # When the target format is NOT raw, we need to convert it. |
0 commit comments