Merge "Pass global-request-id to ironic-python-agent"
This commit is contained in:
commit
672ce00e26
@ -744,7 +744,7 @@ def build_instance_pxe_options(task, pxe_info, ipxe_enabled=False):
|
|||||||
return pxe_opts
|
return pxe_opts
|
||||||
|
|
||||||
|
|
||||||
def build_extra_pxe_options(ramdisk_params=None):
|
def build_extra_pxe_options(task=None, ramdisk_params=None):
|
||||||
# Enable debug in IPA according to CONF.debug if it was not
|
# Enable debug in IPA according to CONF.debug if it was not
|
||||||
# specified yet
|
# specified yet
|
||||||
pxe_append_params = CONF.pxe.pxe_append_params
|
pxe_append_params = CONF.pxe.pxe_append_params
|
||||||
@ -753,6 +753,9 @@ def build_extra_pxe_options(ramdisk_params=None):
|
|||||||
if ramdisk_params:
|
if ramdisk_params:
|
||||||
pxe_append_params += ' ' + ' '.join('%s=%s' % tpl
|
pxe_append_params += ' ' + ' '.join('%s=%s' % tpl
|
||||||
for tpl in ramdisk_params.items())
|
for tpl in ramdisk_params.items())
|
||||||
|
if task and task.context.global_id:
|
||||||
|
pxe_append_params += (
|
||||||
|
' ipa-global-request-id=%s' % task.context.global_id)
|
||||||
|
|
||||||
return {'pxe_append_params': pxe_append_params,
|
return {'pxe_append_params': pxe_append_params,
|
||||||
'tftp_server': CONF.pxe.tftp_server,
|
'tftp_server': CONF.pxe.tftp_server,
|
||||||
@ -800,7 +803,7 @@ def build_pxe_config_options(task, pxe_info, service=False,
|
|||||||
pxe_options.update(build_instance_pxe_options(task, pxe_info,
|
pxe_options.update(build_instance_pxe_options(task, pxe_info,
|
||||||
ipxe_enabled=ipxe_enabled))
|
ipxe_enabled=ipxe_enabled))
|
||||||
|
|
||||||
pxe_options.update(build_extra_pxe_options(ramdisk_params))
|
pxe_options.update(build_extra_pxe_options(task, ramdisk_params))
|
||||||
|
|
||||||
return pxe_options
|
return pxe_options
|
||||||
|
|
||||||
|
@ -1249,6 +1249,8 @@ class PXEBuildConfigOptionsTestCase(db_base.DbTestCase):
|
|||||||
if ramdisk_params:
|
if ramdisk_params:
|
||||||
expected_pxe_params += ' ' + ' '.join(
|
expected_pxe_params += ' ' + ' '.join(
|
||||||
'%s=%s' % tpl for tpl in ramdisk_params.items())
|
'%s=%s' % tpl for tpl in ramdisk_params.items())
|
||||||
|
expected_pxe_params += (
|
||||||
|
" ipa-global-request-id=%s" % self.context.global_id)
|
||||||
|
|
||||||
expected_options = {
|
expected_options = {
|
||||||
'deployment_ari_path': pxe_ramdisk,
|
'deployment_ari_path': pxe_ramdisk,
|
||||||
@ -1305,8 +1307,8 @@ class PXEBuildConfigOptionsTestCase(db_base.DbTestCase):
|
|||||||
del self.node.driver_internal_info['is_whole_disk_image']
|
del self.node.driver_internal_info['is_whole_disk_image']
|
||||||
self.node.save()
|
self.node.save()
|
||||||
pxe_params = 'my-pxe-append-params ipa-debug=0'
|
pxe_params = 'my-pxe-append-params ipa-debug=0'
|
||||||
self.config(group='pxe', tftp_server='my-tftp-server')
|
|
||||||
self.config(group='pxe', pxe_append_params=pxe_params)
|
self.config(group='pxe', pxe_append_params=pxe_params)
|
||||||
|
self.config(group='pxe', tftp_server='my-tftp-server')
|
||||||
self.config(group='pxe', tftp_root='/tftp-path/')
|
self.config(group='pxe', tftp_root='/tftp-path/')
|
||||||
image_info = {
|
image_info = {
|
||||||
'deploy_kernel': ('deploy_kernel',
|
'deploy_kernel': ('deploy_kernel',
|
||||||
@ -1325,7 +1327,8 @@ class PXEBuildConfigOptionsTestCase(db_base.DbTestCase):
|
|||||||
'ari_path': 'no_ramdisk',
|
'ari_path': 'no_ramdisk',
|
||||||
'deployment_aki_path': 'path-to-deploy_kernel',
|
'deployment_aki_path': 'path-to-deploy_kernel',
|
||||||
'deployment_ari_path': 'path-to-deploy_ramdisk',
|
'deployment_ari_path': 'path-to-deploy_ramdisk',
|
||||||
'pxe_append_params': pxe_params,
|
'pxe_append_params': pxe_params + (
|
||||||
|
" ipa-global-request-id=%s" % self.context.global_id),
|
||||||
'tftp_server': 'my-tftp-server',
|
'tftp_server': 'my-tftp-server',
|
||||||
'ipxe_timeout': 0}
|
'ipxe_timeout': 0}
|
||||||
self.assertEqual(expected_options, options)
|
self.assertEqual(expected_options, options)
|
||||||
@ -1530,6 +1533,8 @@ class iPXEBuildConfigOptionsTestCase(db_base.DbTestCase):
|
|||||||
expected_pxe_params = 'test_param'
|
expected_pxe_params = 'test_param'
|
||||||
if debug:
|
if debug:
|
||||||
expected_pxe_params += ' ipa-debug=1'
|
expected_pxe_params += ' ipa-debug=1'
|
||||||
|
expected_pxe_params += (
|
||||||
|
' ipa-global-request-id=%s' % self.context.global_id)
|
||||||
|
|
||||||
expected_options = {
|
expected_options = {
|
||||||
'deployment_ari_path': pxe_ramdisk,
|
'deployment_ari_path': pxe_ramdisk,
|
||||||
|
Loading…
Reference in New Issue
Block a user