diff options
author | Julia Kreger <juliaashleykreger@gmail.com> | 2022-08-04 10:10:00 -0700 |
---|---|---|
committer | Julia Kreger <juliaashleykreger@gmail.com> | 2022-08-04 10:42:01 -0700 |
commit | 7b47e09a385d388854a3c81bc13c333b36c18a36 (patch) | |
tree | 776b6eb3af263a37b4dcd1670dc01108898d8015 /ironic/common/pxe_utils.py | |
parent | 86638d1dfdfe770ac4317ae3546cc7816f7f5cf1 (diff) | |
download | ironic-7b47e09a385d388854a3c81bc13c333b36c18a36.tar.gz |
Fix pxe image lookups
Image lookups in the PXE interface, for anaconda specific code,
were previously hard coded to try and invoke use of glance if
needed.
Except, not everything is glance.
Change-Id: I8791623be95e7e47739ee051753de97eb0e5e2a3
Diffstat (limited to 'ironic/common/pxe_utils.py')
-rw-r--r-- | ironic/common/pxe_utils.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/ironic/common/pxe_utils.py b/ironic/common/pxe_utils.py index 88c55d6d7..40ad98217 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': |