diff --git a/ironic/drivers/modules/pxe.py b/ironic/drivers/modules/pxe.py index ea0be690fe..0cf4167483 100644 --- a/ironic/drivers/modules/pxe.py +++ b/ironic/drivers/modules/pxe.py @@ -49,7 +49,14 @@ REQUIRED_PROPERTIES = { 'deploy_ramdisk': _("UUID (from Glance) of the ramdisk that is " "mounted at boot time. Required."), } -COMMON_PROPERTIES = REQUIRED_PROPERTIES +OPTIONAL_PROPERTIES = { + 'force_persistent_boot_device': _("True to enable persistent behavior " + "when the boot device is set during " + "deploy and cleaning operations. " + "Defaults to False. Optional."), +} +COMMON_PROPERTIES = REQUIRED_PROPERTIES.copy() +COMMON_PROPERTIES.update(OPTIONAL_PROPERTIES) def _parse_driver_info(node): diff --git a/ironic/tests/unit/conductor/test_manager.py b/ironic/tests/unit/conductor/test_manager.py index 2b7913b476..24f467f07e 100644 --- a/ironic/tests/unit/conductor/test_manager.py +++ b/ironic/tests/unit/conductor/test_manager.py @@ -5029,7 +5029,7 @@ class ManagerTestProperties(mgr_utils.ServiceSetUpMixin, db_base.DbTestCase): def test_driver_properties_fake_pxe(self): expected = ['deploy_kernel', 'deploy_ramdisk', - 'deploy_forces_oob_reboot'] + 'force_persistent_boot_device', 'deploy_forces_oob_reboot'] self._check_driver_properties("fake_pxe", expected) def test_driver_properties_fake_snmp(self): @@ -5043,12 +5043,14 @@ class ManagerTestProperties(mgr_utils.ServiceSetUpMixin, db_base.DbTestCase): 'ipmi_username', 'ipmi_bridging', 'ipmi_transit_channel', 'ipmi_transit_address', 'ipmi_target_channel', 'ipmi_target_address', 'ipmi_local_address', - 'deploy_kernel', 'deploy_ramdisk', 'ipmi_protocol_version', + 'deploy_kernel', 'deploy_ramdisk', + 'force_persistent_boot_device', 'ipmi_protocol_version', 'ipmi_force_boot_device', 'deploy_forces_oob_reboot'] self._check_driver_properties("pxe_ipmitool", expected) def test_driver_properties_pxe_snmp(self): expected = ['deploy_kernel', 'deploy_ramdisk', + 'force_persistent_boot_device', 'snmp_driver', 'snmp_address', 'snmp_port', 'snmp_version', 'snmp_community', 'snmp_security', 'snmp_outlet', 'deploy_forces_oob_reboot'] @@ -5107,7 +5109,7 @@ class ManagerTestHardwareTypeProperties(mgr_utils.ServiceSetUpMixin, def test_hardware_type_properties_manual_management(self): expected = ['deploy_kernel', 'deploy_ramdisk', - 'deploy_forces_oob_reboot'] + 'force_persistent_boot_device', 'deploy_forces_oob_reboot'] self._check_hardware_type_properties('manual-management', expected) diff --git a/ironic/tests/unit/drivers/test_generic.py b/ironic/tests/unit/drivers/test_generic.py index 4c4e5e9b6b..cfc0cb97ea 100644 --- a/ironic/tests/unit/drivers/test_generic.py +++ b/ironic/tests/unit/drivers/test_generic.py @@ -66,7 +66,8 @@ class ManualManagementHardwareTestCase(db_base.DbTestCase): def test_get_properties(self): # These properties are from vendor (agent) and boot (pxe) interfaces expected_prop_keys = [ - 'deploy_forces_oob_reboot', 'deploy_kernel', 'deploy_ramdisk'] + 'deploy_forces_oob_reboot', 'deploy_kernel', 'deploy_ramdisk', + 'force_persistent_boot_device'] hardware_type = driver_factory.get_hardware_type("manual-management") properties = hardware_type.get_properties() self.assertEqual(sorted(expected_prop_keys), sorted(properties.keys()))