summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Horstmann <j.horstmann@mittwald.de>2019-08-30 11:42:27 +0200
committerRiccardo Pittau <elfosardo@gmail.com>2019-09-16 10:27:09 +0200
commit5b9dea88c2b1ea1de8c0ddc4ac8d07826b582731 (patch)
tree246d261486e801539e0acb68515b6103f6ee12d9
parenta303778f158b999f6ab2d79d218543c31b045745 (diff)
downloadironic-5b9dea88c2b1ea1de8c0ddc4ac8d07826b582731.tar.gz
Fix typo in handling of exception FailedToGetIPAddressOnPort
Function create_pxe_config in ironic/common/pxe_utils.py tried to handle exception FailedToGetIPaddressesOnPort. However, the raised exception is called FailedToGetIPAddressOnPort. Change-Id: I33e51f064daa0a0d70dd87e163d401c0e7b922bc Story: 2006478 Task: 36419 (cherry picked from commit 22db498ea1d02119d7662f566e299d04a09e9ae5)
-rw-r--r--ironic/common/pxe_utils.py2
-rw-r--r--ironic/tests/unit/common/test_pxe_utils.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/ironic/common/pxe_utils.py b/ironic/common/pxe_utils.py
index cb8036d7b..9b3860ae4 100644
--- a/ironic/common/pxe_utils.py
+++ b/ironic/common/pxe_utils.py
@@ -275,7 +275,7 @@ def create_pxe_config(task, pxe_options, template=None):
# in the MAC addresses and DHCP files being written, and
# we can remove IP address creation for the grub use
# case, considering that will ease removal of elilo support.
- except exception.FailedToGetIPaddressesOnPort as e:
+ except exception.FailedToGetIPAddressOnPort as e:
if CONF.dhcp.dhcp_provider != 'none':
with excutils.save_and_reraise_exception():
LOG.error('Unable to create boot config, IP address '
diff --git a/ironic/tests/unit/common/test_pxe_utils.py b/ironic/tests/unit/common/test_pxe_utils.py
index edf884b59..5af866a5c 100644
--- a/ironic/tests/unit/common/test_pxe_utils.py
+++ b/ironic/tests/unit/common/test_pxe_utils.py
@@ -540,8 +540,9 @@ class TestPXEUtils(db_base.DbTestCase):
# TODO(TheJulia): We should... like... fix the template to
# enable mac address usage.....
grub_tmplte = "ironic/drivers/modules/pxe_grub_config.template"
- link_ip_configs_mock.side_efect = exception.FailedToGetIPAddressOnPort(
- port_id='blah')
+ self.config(dhcp_provider='none', group='dhcp')
+ link_ip_configs_mock.side_effect = \
+ exception.FailedToGetIPAddressOnPort(port_id='blah')
with task_manager.acquire(self.context, self.node.uuid) as task:
task.node.properties['capabilities'] = 'boot_mode:uefi'
pxe_utils.create_pxe_config(task, self.pxe_options,