Merge "Fix bug where clean steps do not run"
This commit is contained in:
commit
3d1ac2d83d
@ -835,10 +835,11 @@ class ConductorManager(periodic_task.PeriodicTasks):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
node = task.node
|
node = task.node
|
||||||
if not node.clean_step:
|
|
||||||
return []
|
|
||||||
|
|
||||||
next_steps = node.driver_internal_info.get('clean_steps', [])
|
next_steps = node.driver_internal_info.get('clean_steps', [])
|
||||||
|
if not node.clean_step:
|
||||||
|
# first time through, return all steps
|
||||||
|
return next_steps
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Trim off the last clean step (now finished) and
|
# Trim off the last clean step (now finished) and
|
||||||
# all previous steps
|
# all previous steps
|
||||||
|
@ -2064,6 +2064,20 @@ class DoNodeCleanTestCase(_ServiceSetUpMixin, tests_db_base.DbTestCase):
|
|||||||
steps = self.service._get_node_next_clean_steps(task)
|
steps = self.service._get_node_next_clean_steps(task)
|
||||||
self.assertEqual(self.next_clean_steps, steps)
|
self.assertEqual(self.next_clean_steps, steps)
|
||||||
|
|
||||||
|
def test__get_node_next_clean_steps_unset_clean_step(self):
|
||||||
|
driver_internal_info = {'clean_steps': self.clean_steps}
|
||||||
|
node = obj_utils.create_test_node(
|
||||||
|
self.context, driver='fake',
|
||||||
|
provision_state=states.CLEANWAIT,
|
||||||
|
target_provision_state=states.AVAILABLE,
|
||||||
|
driver_internal_info=driver_internal_info,
|
||||||
|
last_error=None,
|
||||||
|
clean_step=None)
|
||||||
|
|
||||||
|
with task_manager.acquire(self.context, node.uuid) as task:
|
||||||
|
steps = self.service._get_node_next_clean_steps(task)
|
||||||
|
self.assertEqual(self.clean_steps, steps)
|
||||||
|
|
||||||
def test__get_node_next_clean_steps_bad_clean_step(self):
|
def test__get_node_next_clean_steps_bad_clean_step(self):
|
||||||
driver_internal_info = {'clean_steps': self.clean_steps}
|
driver_internal_info = {'clean_steps': self.clean_steps}
|
||||||
node = obj_utils.create_test_node(
|
node = obj_utils.create_test_node(
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
prelude: >
|
||||||
|
A major bug was fixed where clean steps do not run.
|
||||||
|
critical:
|
||||||
|
- This fixes a bug where Ironic skipped all clean steps,
|
||||||
|
which may leave the previous tenant's data on disk
|
||||||
|
available to new users.
|
||||||
|
security:
|
||||||
|
- This fixes a bug where Ironic skipped all clean steps,
|
||||||
|
which may leave the previous tenant's data on disk
|
||||||
|
available to new users.
|
Loading…
x
Reference in New Issue
Block a user