Remove support for 'hexraw' iPXE type

This removes support for "hexraw" type in the iPXE script
(boot.ipxe) since "hexraw" is not supported in older
versions of iPXE. "hexhyp" replaced "hexraw" and has been
used since kilo.

Also addresses a nit in the original patch
(https://review.openstack.org/#/c/171759/). For
_get_pxe_mac_path(),  changed the assigned value of
'delimiter' argument from None to '-' (because it
was coded to be '-' as the default).

Change-Id: Ide05ff7c4689cd696e2fe76be98ff99c0be24236
This commit is contained in:
Ruby Loo 2016-05-30 10:56:04 -04:00
parent 67fdbb4de8
commit cdd8d938f8
3 changed files with 9 additions and 26 deletions

View File

@ -93,11 +93,6 @@ def _link_mac_pxe_configs(task):
pxe_config_file_path = get_pxe_config_file_path(task.node.uuid)
for mac in driver_utils.get_node_mac_addresses(task):
create_link(_get_pxe_mac_path(mac))
# TODO(lucasagomes): Backward compatibility with :hexraw,
# to be removed in Mitaka.
# see: https://bugs.launchpad.net/ironic/+bug/1441710
if CONF.pxe.ipxe_enabled:
create_link(_get_pxe_mac_path(mac, delimiter=''))
def _link_ip_address_pxe_configs(task, hex_form):
@ -128,7 +123,7 @@ def _link_ip_address_pxe_configs(task, hex_form):
ip_address_path)
def _get_pxe_mac_path(mac, delimiter=None):
def _get_pxe_mac_path(mac, delimiter='-'):
"""Convert a MAC address into a PXE config file name.
:param mac: A MAC address string in the format xx:xx:xx:xx:xx:xx.
@ -136,9 +131,6 @@ def _get_pxe_mac_path(mac, delimiter=None):
:returns: the path to the config file.
"""
if delimiter is None:
delimiter = '-'
mac_file_name = mac.replace(':', delimiter).lower()
if not CONF.pxe.ipxe_enabled:
mac_file_name = '01-' + mac_file_name
@ -283,12 +275,6 @@ def clean_up_pxe_config(task):
else:
for mac in driver_utils.get_node_mac_addresses(task):
ironic_utils.unlink_without_raise(_get_pxe_mac_path(mac))
# TODO(lucasagomes): Backward compatibility with :hexraw,
# to be removed in Mitaka.
# see: https://bugs.launchpad.net/ironic/+bug/1441710
if CONF.pxe.ipxe_enabled:
ironic_utils.unlink_without_raise(_get_pxe_mac_path(mac,
delimiter=''))
utils.rmtree_without_raise(os.path.join(get_root_dir(),
task.node.uuid))

View File

@ -237,18 +237,12 @@ class TestPXEUtils(db_base.DbTestCase):
create_link_calls = [
mock.call(u'../1be26c0b-03f2-4d2e-ae87-c02d7f33c123/config',
'/httpboot/pxelinux.cfg/00-11-22-33-44-55-66'),
mock.call(u'../1be26c0b-03f2-4d2e-ae87-c02d7f33c123/config',
'/httpboot/pxelinux.cfg/00112233445566'),
mock.call(u'../1be26c0b-03f2-4d2e-ae87-c02d7f33c123/config',
'/httpboot/pxelinux.cfg/00-11-22-33-44-55-67'),
mock.call(u'../1be26c0b-03f2-4d2e-ae87-c02d7f33c123/config',
'/httpboot/pxelinux.cfg/00112233445567'),
]
unlink_calls = [
mock.call('/httpboot/pxelinux.cfg/00-11-22-33-44-55-66'),
mock.call('/httpboot/pxelinux.cfg/00112233445566'),
mock.call('/httpboot/pxelinux.cfg/00-11-22-33-44-55-67'),
mock.call('/httpboot/pxelinux.cfg/00112233445567'),
]
with task_manager.acquire(self.context, self.node.uuid) as task:
pxe_utils._link_mac_pxe_configs(task)
@ -614,10 +608,7 @@ class TestPXEUtils(db_base.DbTestCase):
task.node.properties = properties
pxe_utils.clean_up_pxe_config(task)
unlink_calls = [
mock.call('/httpboot/pxelinux.cfg/aa-aa-aa-aa-aa-aa'),
mock.call('/httpboot/pxelinux.cfg/aaaaaaaaaaaa')
]
unlink_mock.assert_has_calls(unlink_calls)
unlink_mock.assert_called_once_with(
'/httpboot/pxelinux.cfg/aa-aa-aa-aa-aa-aa')
rmtree_mock.assert_called_once_with(
os.path.join(CONF.deploy.http_root, self.node.uuid))

View File

@ -0,0 +1,6 @@
---
upgrade:
- Removes support for "hexraw" type in the iPXE script
(boot.ipxe) since "hexraw" is not supported in older
versions of iPXE. "hexhyp" replaced "hexraw" and has
been used since kilo.