summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/agent.py
diff options
context:
space:
mode:
authorShivanand Tendulker <stendulker@gmail.com>2019-08-01 08:20:00 -0400
committerShivanand Tendulker <stendulker@gmail.com>2019-08-07 15:42:28 -0400
commit8f907886a1ed0de70c34aef84ba892c3e6a5cd49 (patch)
tree0c285d5b311d54aa226ced62e73f41e7a425c7de /ironic/drivers/modules/agent.py
parent71b7441b781405ff9b11d3a044e266a07e3a0b93 (diff)
downloadironic-8f907886a1ed0de70c34aef84ba892c3e6a5cd49.tar.gz
Asynchronous out of band deploy steps fails to execute
Asynchronous out of band steps in a deploy template fails to execute. This commit fixes that issue. Asynchronous steps can set 'skip_current_deploy_step' flag to False in 'driver_internal_info' to make sure that upon reboot same step is re-executed. Also it can set 'deployment_reboot' flag to True in 'driver_internal_info' to signal that it has rebooted the node. Co-Authored-By: Mark Goddard <mark@stackhpc.com> Change-Id: If6217afb5453c311d5ca71ba37458a9b97c18395 Story: 2006342 Task: 36095
Diffstat (limited to 'ironic/drivers/modules/agent.py')
-rw-r--r--ironic/drivers/modules/agent.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/ironic/drivers/modules/agent.py b/ironic/drivers/modules/agent.py
index b4f640e30..9e1a067a0 100644
--- a/ironic/drivers/modules/agent.py
+++ b/ironic/drivers/modules/agent.py
@@ -463,7 +463,14 @@ class AgentDeploy(AgentDeployMixin, base.DeployInterface):
task.process_event('wait')
self.continue_deploy(task)
elif task.driver.storage.should_write_image(task):
- manager_utils.node_power_action(task, states.REBOOT)
+ # Check if the driver has already performed a reboot in a previous
+ # deploy step.
+ if not task.node.driver_internal_info.get('deployment_reboot'):
+ manager_utils.node_power_action(task, states.REBOOT)
+ info = task.node.driver_internal_info
+ info.pop('deployment_reboot', None)
+ task.node.driver_internal_info = info
+ task.node.save()
return states.DEPLOYWAIT
else:
# TODO(TheJulia): At some point, we should de-dupe this code