diff options
author | Naohiro Tamura <naohirot@jp.fujitsu.com> | 2015-07-31 00:34:08 +0900 |
---|---|---|
committer | Naohiro Tamura <naohirot@jp.fujitsu.com> | 2017-01-04 11:38:01 +0900 |
commit | f15d5b9a37260b3876f9dadeb030412e6e1053b2 (patch) | |
tree | 0b1196f59d8d17b5a90b4fcced2f881297ade9de /ironic/conductor/rpcapi.py | |
parent | 480d5be0239b46b35b557586363b455cc1c08622 (diff) | |
download | ironic-f15d5b9a37260b3876f9dadeb030412e6e1053b2.tar.gz |
Generic power interface for soft reboot and soft power off
This patch updates the generic power interface to support SOFT_REBOOT
and SOFT_POWER_OFF. And also it introduces "timeout" optional
parameter for all power operations.
Partial-Bug: #1526226
Change-Id: I1c9bbd1f11f6a8565607c874b3c99aa10eeb62a5
Diffstat (limited to 'ironic/conductor/rpcapi.py')
-rw-r--r-- | ironic/conductor/rpcapi.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ironic/conductor/rpcapi.py b/ironic/conductor/rpcapi.py index 369806f1c..d6d433edf 100644 --- a/ironic/conductor/rpcapi.py +++ b/ironic/conductor/rpcapi.py @@ -85,11 +85,12 @@ class ConductorAPI(object): | 1.36 - Added create_node | 1.37 - Added destroy_volume_target and update_volume_target | 1.38 - Added vif_attach, vif_detach, vif_list + | 1.39 - Added timeout optional parameter to change_node_power_state """ # NOTE(rloo): This must be in sync with manager.ConductorManager's. - RPC_API_VERSION = '1.38' + RPC_API_VERSION = '1.39' def __init__(self, topic=None): super(ConductorAPI, self).__init__() @@ -179,7 +180,8 @@ class ConductorAPI(object): cctxt = self.client.prepare(topic=topic or self.topic, version='1.1') return cctxt.call(context, 'update_node', node_obj=node_obj) - def change_node_power_state(self, context, node_id, new_state, topic=None): + def change_node_power_state(self, context, node_id, new_state, + topic=None, timeout=None): """Change a node's power state. Synchronously, acquire lock and start the conductor background task @@ -188,14 +190,16 @@ class ConductorAPI(object): :param context: request context. :param node_id: node id or uuid. :param new_state: one of ironic.common.states power state values + :param timeout: timeout (in seconds) positive integer (> 0) for any + power state. ``None`` indicates to use default timeout. :param topic: RPC topic. Defaults to self.topic. :raises: NoFreeConductorWorker when there is no free worker to start async task. """ - cctxt = self.client.prepare(topic=topic or self.topic, version='1.6') + cctxt = self.client.prepare(topic=topic or self.topic, version='1.39') return cctxt.call(context, 'change_node_power_state', node_id=node_id, - new_state=new_state) + new_state=new_state, timeout=timeout) def vendor_passthru(self, context, node_id, driver_method, http_method, info, topic=None): |