summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/fake.py
diff options
context:
space:
mode:
authorMark Goddard <mark@stackhpc.com>2018-07-03 19:41:00 +0100
committerRuby Loo <rloo@oath.com>2018-07-11 16:18:59 +0000
commit65a68e4e96151f8190f9767e3ff6f8d5891af687 (patch)
tree5df8c6206343d22519c2f3886e430c1ea368f866 /ironic/drivers/modules/fake.py
parentaac5bcb3e41e2b4405fb2ecd2cc4fe95cf185690 (diff)
downloadironic-65a68e4e96151f8190f9767e3ff6f8d5891af687.tar.gz
Deploy steps - conductor & drivers
This adds a 'deploy_step' decorator. A deploy step must take as the only positional argument, a TaskManager object. A step can be executed synchronously or asynchronously. A step should return None if the method has completed synchronously or states.DEPLOYWAIT if the step will continue to execute asynchronously. If the step executes asynchronously, it should issue a call to the 'continue_node_deploy' RPC, so the conductor can begin the next deploy step. Only steps with priorities greater than 0 are used. These steps are ordered by priority from highest value to lowest value. For steps with the same priority, they are ordered by driver interface priority (see conductor.manager.DEPLOYING_INTERFACE_PRIORITY). All in-tree DeployInterfaces are converted to have one big deploy_step (their existing deploy() method). A new RPC method 'continue_node_deploy' (RPC API version 1.45) is used by deploy steps to notify the conductor to continue node deployment (e.g. execute the next deploy step). Similar to cleaning, the conductor gets the node's deploy steps and executes them, one at a time (one deploy step right now). The conductor also handles out-of-tree drivers that don't have deploy steps yet; a warning is logged in these cases. Co-Authored-By: Ruby Loo <rloo@oath.com> Change-Id: I5feac3856cc4b87a850180b7fd0b3b9805f9225f Story: #1753128 Task: #22592
Diffstat (limited to 'ironic/drivers/modules/fake.py')
-rw-r--r--ironic/drivers/modules/fake.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ironic/drivers/modules/fake.py b/ironic/drivers/modules/fake.py
index d588675eb..680958f02 100644
--- a/ironic/drivers/modules/fake.py
+++ b/ironic/drivers/modules/fake.py
@@ -85,7 +85,7 @@ class FakeBoot(base.BootInterface):
class FakeDeploy(base.DeployInterface):
"""Class for a fake deployment driver.
- Example imlementation of a deploy interface that uses a
+ Example implementation of a deploy interface that uses a
separate power interface.
"""
@@ -95,8 +95,9 @@ class FakeDeploy(base.DeployInterface):
def validate(self, task):
pass
+ @base.deploy_step(priority=100)
def deploy(self, task):
- return states.DEPLOYDONE
+ return None
def tear_down(self, task):
return states.DELETED