summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2022-11-01 04:35:10 +0000
committerGerrit Code Review <review@openstack.org>2022-11-01 04:35:10 +0000
commitc2fd695cd57497b694e97d05265b9bcc45b008e7 (patch)
treed7aab21e12318e2a203379b843687879b7f35347
parente2471779f7e85ab28560278cbb73334cdacfd14c (diff)
parent42b6941f878e8db36a0265c0139dd10025ec673f (diff)
downloadironic-c2fd695cd57497b694e97d05265b9bcc45b008e7.tar.gz
Merge "Fix pxe image lookups" into bugfix/20.2
-rw-r--r--ironic/common/pxe_utils.py17
-rw-r--r--releasenotes/notes/fix-pxe-glance-lookup-anaconda-86fe616c6286ec08.yaml6
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.