diff options
-rw-r--r-- | ironic/common/pxe_utils.py | 17 | ||||
-rw-r--r-- | releasenotes/notes/fix-pxe-glance-lookup-anaconda-86fe616c6286ec08.yaml | 6 |
2 files changed, 17 insertions, 6 deletions
diff --git a/ironic/common/pxe_utils.py b/ironic/common/pxe_utils.py index b0f1d906f..4a763ee27 100644 --- a/ironic/common/pxe_utils.py +++ b/ironic/common/pxe_utils.py @@ -681,8 +681,10 @@ def get_instance_image_info(task, ipxe_enabled=False): def _get_image_properties(): nonlocal image_properties if not image_properties: - glance_service = service.GlanceImageService(context=ctx) - image_properties = glance_service.show( + i_service = service.get_image_service( + d_info['image_source'], + context=ctx) + image_properties = i_service.show( d_info['image_source'])['properties'] labels = ('kernel', 'ramdisk') @@ -691,10 +693,13 @@ def get_instance_image_info(task, ipxe_enabled=False): # we won't use any of them. We'll use the values specified # with the image, which we assume have been set. _get_image_properties() - for label in labels: - i_info[label] = str(image_properties[label + '_id']) - node.instance_info = i_info - node.save() + if image_properties: + # This is intended for Glance usage, but all image properties + # should be routed through the image service request routing. + for label in labels: + i_info[label] = str(image_properties[label + '_id']) + node.instance_info = i_info + node.save() anaconda_labels = () if deploy_utils.get_boot_option(node) == 'kickstart': diff --git a/releasenotes/notes/fix-pxe-glance-lookup-anaconda-86fe616c6286ec08.yaml b/releasenotes/notes/fix-pxe-glance-lookup-anaconda-86fe616c6286ec08.yaml new file mode 100644 index 000000000..bf6b8ea85 --- /dev/null +++ b/releasenotes/notes/fix-pxe-glance-lookup-anaconda-86fe616c6286ec08.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes an issue in the ``anaconda`` deployment interface where PXE argument + processing and preparation was erroniously directly connecting to Glance, + potentially leading to an exception in the standalone use case. |