Merge "Updates boot mode on the baremetal as per boot_mode
"
This commit is contained in:
commit
fe6112103f
@ -451,13 +451,7 @@ class IloVirtualMediaBoot(base.BootInterface):
|
||||
states.RESCUING):
|
||||
return
|
||||
|
||||
# Powering off the Node before initiating boot for node cleaning.
|
||||
# If node is in system POST, setting boot device fails.
|
||||
manager_utils.node_power_action(task, states.POWER_OFF)
|
||||
|
||||
if node.provision_state in (states.DEPLOYING,
|
||||
states.RESCUING):
|
||||
prepare_node_for_deploy(task)
|
||||
prepare_node_for_deploy(task)
|
||||
|
||||
# Clear ilo_boot_iso if it's a glance image to force recreate
|
||||
# another one again (or use existing one in glance).
|
||||
@ -655,7 +649,8 @@ class IloPXEBoot(pxe.PXEBoot):
|
||||
:raises: IloOperationError, if some operation on iLO failed.
|
||||
"""
|
||||
|
||||
if task.node.provision_state in (states.DEPLOYING, states.RESCUING):
|
||||
if task.node.provision_state in (states.DEPLOYING, states.RESCUING,
|
||||
states.CLEANING):
|
||||
prepare_node_for_deploy(task)
|
||||
|
||||
super(IloPXEBoot, self).prepare_ramdisk(task, ramdisk_params)
|
||||
|
@ -726,8 +726,6 @@ class IloVirtualMediaBootTestCase(db_base.DbTestCase):
|
||||
|
||||
@mock.patch.object(ilo_boot, 'prepare_node_for_deploy',
|
||||
spec_set=True, autospec=True)
|
||||
@mock.patch.object(manager_utils, 'node_power_action',
|
||||
spec_set=True, autospec=True)
|
||||
@mock.patch.object(ilo_common, 'eject_vmedia_devices',
|
||||
spec_set=True, autospec=True)
|
||||
@mock.patch.object(ilo_common, 'setup_vmedia', spec_set=True,
|
||||
@ -735,7 +733,7 @@ class IloVirtualMediaBootTestCase(db_base.DbTestCase):
|
||||
@mock.patch.object(deploy_utils, 'get_single_nic_with_vif_port_id',
|
||||
spec_set=True, autospec=True)
|
||||
def _test_prepare_ramdisk(self, get_nic_mock, setup_vmedia_mock,
|
||||
eject_mock, node_power_mock,
|
||||
eject_mock,
|
||||
prepare_node_for_deploy_mock,
|
||||
ilo_boot_iso, image_source,
|
||||
ramdisk_params={'a': 'b'},
|
||||
@ -757,11 +755,7 @@ class IloVirtualMediaBootTestCase(db_base.DbTestCase):
|
||||
|
||||
task.driver.boot.prepare_ramdisk(task, ramdisk_params)
|
||||
|
||||
node_power_mock.assert_called_once_with(task, states.POWER_OFF)
|
||||
if task.node.provision_state in (states.DEPLOYING,
|
||||
states.RESCUING):
|
||||
prepare_node_for_deploy_mock.assert_called_once_with(task)
|
||||
|
||||
prepare_node_for_deploy_mock.assert_called_once_with(task)
|
||||
eject_mock.assert_called_once_with(task)
|
||||
expected_ramdisk_opts = {'a': 'b', 'BOOTIF': '12:34:56:78:90:ab'}
|
||||
get_nic_mock.assert_called_once_with(task)
|
||||
@ -1148,23 +1142,6 @@ class IloPXEBootTestCase(db_base.DbTestCase):
|
||||
self.node = obj_utils.create_test_node(
|
||||
self.context, driver='pxe_ilo', driver_info=INFO_DICT)
|
||||
|
||||
@mock.patch.object(ilo_boot, 'prepare_node_for_deploy', spec_set=True,
|
||||
autospec=True)
|
||||
@mock.patch.object(pxe.PXEBoot, 'prepare_ramdisk', spec_set=True,
|
||||
autospec=True)
|
||||
def test_prepare_ramdisk_in_cleaning(
|
||||
self, pxe_prepare_ramdisk_mock, prepare_node_mock):
|
||||
self.node.provision_state = states.CLEANING
|
||||
self.node.save()
|
||||
with task_manager.acquire(self.context, self.node.uuid,
|
||||
shared=False) as task:
|
||||
self.assertIsNone(
|
||||
task.driver.boot.prepare_ramdisk(task, None))
|
||||
|
||||
self.assertFalse(prepare_node_mock.called)
|
||||
pxe_prepare_ramdisk_mock.assert_called_once_with(
|
||||
mock.ANY, task, None)
|
||||
|
||||
@mock.patch.object(ilo_boot, 'prepare_node_for_deploy', spec_set=True,
|
||||
autospec=True)
|
||||
@mock.patch.object(pxe.PXEBoot, 'prepare_ramdisk', spec_set=True,
|
||||
@ -1188,6 +1165,9 @@ class IloPXEBootTestCase(db_base.DbTestCase):
|
||||
def test_prepare_ramdisk_in_rescuing(self):
|
||||
self._test_prepare_ramdisk_needs_node_prep(prov_state=states.RESCUING)
|
||||
|
||||
def test_prepare_ramdisk_in_cleaning(self):
|
||||
self._test_prepare_ramdisk_needs_node_prep(prov_state=states.CLEANING)
|
||||
|
||||
@mock.patch.object(deploy_utils, 'is_iscsi_boot',
|
||||
spec_set=True, autospec=True)
|
||||
@mock.patch.object(ilo_common, 'update_secure_boot_mode', spec_set=True,
|
||||
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Updates the boot mode on the baremetal for cleaning scenario as per
|
||||
given ``boot_mode`` in node's properties/capabilities. This change
|
||||
is for ``ilo`` hardware type.
|
||||
See `bug 1559835 <https://bugs.launchpad.net/ironic/+bug/1559835>`_
|
||||
for more details.
|
Loading…
Reference in New Issue
Block a user