Merge "Fix setting persistent boot device does not work"

This commit is contained in:
Jenkins 2017-02-06 11:48:06 +00:00 committed by Gerrit Code Review
commit 77bcccf98c
3 changed files with 10 additions and 2 deletions

View File

@ -220,6 +220,7 @@ def force_persistent_boot(task, device, persistent):
node = task.node node = task.node
driver_internal_info = node.driver_internal_info driver_internal_info = node.driver_internal_info
if persistent: if persistent:
driver_internal_info.pop('is_next_boot_persistent', None)
driver_internal_info['persistent_boot_device'] = device driver_internal_info['persistent_boot_device'] = device
else: else:
driver_internal_info['is_next_boot_persistent'] = False driver_internal_info['is_next_boot_persistent'] = False

View File

@ -158,8 +158,10 @@ class UtilsTestCase(db_base.DbTestCase):
ret = driver_utils.force_persistent_boot(task, 'pxe', True) ret = driver_utils.force_persistent_boot(task, 'pxe', True)
self.assertIsNone(ret) self.assertIsNone(ret)
task.node.refresh() task.node.refresh()
self.assertIn('persistent_boot_device', self.assertIn(('persistent_boot_device', 'pxe'),
task.node.driver_internal_info) task.node.driver_internal_info.items())
self.assertNotIn('is_next_boot_persistent',
task.node.driver_internal_info)
def test_force_persistent_boot_false(self): def test_force_persistent_boot_false(self):
with task_manager.acquire(self.context, self.node.uuid, with task_manager.acquire(self.context, self.node.uuid,

View File

@ -0,0 +1,5 @@
---
fixes:
- This fixes the issue setting persistent boot device does not work
with ipmi_force_boot_device=True. For more information, see
https://bugs.launchpad.net/ironic/+bug/1626453