diff options
author | Zuul <zuul@review.opendev.org> | 2022-03-05 00:46:06 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-03-05 00:46:06 +0000 |
commit | 6331605d6c5c44802efb2c6215c6e09354c95e76 (patch) | |
tree | f0b184ba71e09aa4ea5e8e2e7bf049b76b7a040c /ironic/common/pxe_utils.py | |
parent | 7d7147b4b151a8fa5528c329fc452572e6d446a5 (diff) | |
parent | 5e2919b280bb1ab3bc3f0f00555830e25b4faa68 (diff) | |
download | ironic-6331605d6c5c44802efb2c6215c6e09354c95e76.tar.gz |
Merge "Set correct initrd_filename for iPXE when using Swift" into stable/xena
Diffstat (limited to 'ironic/common/pxe_utils.py')
-rw-r--r-- | ironic/common/pxe_utils.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ironic/common/pxe_utils.py b/ironic/common/pxe_utils.py index 08d6d3f98..8ef1bfb47 100644 --- a/ironic/common/pxe_utils.py +++ b/ironic/common/pxe_utils.py @@ -18,6 +18,7 @@ import copy import os import shutil import tempfile +from urllib import parse as urlparse from ironic_lib import utils as ironic_utils import jinja2 @@ -770,6 +771,7 @@ def build_deploy_pxe_options(task, pxe_info, mode='deploy', node = task.node kernel_label = '%s_kernel' % mode ramdisk_label = '%s_ramdisk' % mode + initrd_filename = ramdisk_label for label, option in ((kernel_label, 'deployment_aki_path'), (ramdisk_label, 'deployment_ari_path')): if ipxe_enabled: @@ -778,6 +780,10 @@ def build_deploy_pxe_options(task, pxe_info, mode='deploy', and service_utils.is_glance_image(image_href)): pxe_opts[option] = images.get_temp_url_for_glance_image( task.context, image_href) + if label == ramdisk_label: + path = urlparse.urlparse(pxe_opts[option]).path.strip('/') + if path: + initrd_filename = path.split('/')[-1] else: pxe_opts[option] = '/'.join([CONF.deploy.http_url, node.uuid, label]) @@ -785,7 +791,7 @@ def build_deploy_pxe_options(task, pxe_info, mode='deploy', pxe_opts[option] = get_path_relative_to_tftp_root( pxe_info[label][1]) if ipxe_enabled: - pxe_opts['initrd_filename'] = ramdisk_label + pxe_opts['initrd_filename'] = initrd_filename return pxe_opts |