summaryrefslogtreecommitdiff
path: root/ironic/conductor/task_manager.py
diff options
context:
space:
mode:
authorDmitry Tantsur <dtantsur@protonmail.com>2020-10-06 17:44:07 +0200
committerDmitry Tantsur <dtantsur@protonmail.com>2021-12-06 12:38:04 +0100
commit18d016f7961e8dcac851ae099d63c93a227ac992 (patch)
treef3a23e1947efc7f45c46ee374db6612719e43b57 /ironic/conductor/task_manager.py
parente51c6b930e1e0c64de8f233417a686a24d24de49 (diff)
downloadironic-18d016f7961e8dcac851ae099d63c93a227ac992.tar.gz
Avoid RPC notify_conductor_resume_{deploy,clean} in agent_base
Currently we use an RPC call to the conductor itself to proceed to the next clean or deploy step. This is unnecessary and requires temporary lifting the lock, potentially causing race conditions. This change makes the agent code use continue_node_{deploy,clean} directly. The drivers still need updating, it will be done later. Story: #2008167 Task: #40922 Change-Id: If4763d542029b9021432425532f24a0228f04c25
Diffstat (limited to 'ironic/conductor/task_manager.py')
-rw-r--r--ironic/conductor/task_manager.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ironic/conductor/task_manager.py b/ironic/conductor/task_manager.py
index 5063cb211..509c9ce92 100644
--- a/ironic/conductor/task_manager.py
+++ b/ironic/conductor/task_manager.py
@@ -604,6 +604,14 @@ class TaskManager(object):
# emitted at __exit__().
self._saved_node = self.node
+ def resume_cleaning(self):
+ """A helper to resume cleaning with the right target state."""
+ if self.node.target_provision_state == states.MANAGEABLE:
+ target_state = states.MANAGEABLE
+ else:
+ target_state = None
+ self.process_event('resume', target_state=target_state)
+
def __enter__(self):
return self