diff options
author | Jan Horstmann <j.horstmann@mittwald.de> | 2019-08-30 11:42:27 +0200 |
---|---|---|
committer | Riccardo Pittau <elfosardo@gmail.com> | 2019-09-16 10:29:01 +0200 |
commit | 18a45e8b4902aa9c9d1c60b62c56ec5708d7e320 (patch) | |
tree | 2dbd994cd30991a3fe7a7fd6ff9861fd00753732 | |
parent | 2f3b5e929b2bbad7c23e5198c4d5d310556db101 (diff) | |
download | ironic-18a45e8b4902aa9c9d1c60b62c56ec5708d7e320.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.py | 2 | ||||
-rw-r--r-- | ironic/tests/unit/common/test_pxe_utils.py | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/ironic/common/pxe_utils.py b/ironic/common/pxe_utils.py index e6b2586d9..2e9a34f2c 100644 --- a/ironic/common/pxe_utils.py +++ b/ironic/common/pxe_utils.py @@ -320,7 +320,7 @@ def create_pxe_config(task, pxe_options, template=None, ipxe_enabled=False): # 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 b082a059a..a653e5df7 100644 --- a/ironic/tests/unit/common/test_pxe_utils.py +++ b/ironic/tests/unit/common/test_pxe_utils.py @@ -552,8 +552,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, |