diff options
author | Dmitry Tantsur <divius.inside@gmail.com> | 2018-07-16 15:03:42 +0200 |
---|---|---|
committer | Jim Rollenhagen <jim@jimrollenhagen.com> | 2018-07-18 21:50:13 +0000 |
commit | 597d8a727b1a78a075939e03dbdb8a993765187f (patch) | |
tree | 9840dc378bb571ec4274fab8eebf9adc4dd58faa /ironic/conductor/rpcapi.py | |
parent | 072cf9b5609a84bcd318ccd8e5a2cf15c078821b (diff) | |
download | ironic-597d8a727b1a78a075939e03dbdb8a993765187f.tar.gz |
Add reset_interfaces parameter to node's PATCH
Setting it to true when updating the node's driver resets all hardware
interfaces to their defaults, unless they're also updated.
Change-Id: Ie70dbbed2be0a46f024b859e8141572500fb47c6
Story: #2002868
Task: #22818
Diffstat (limited to 'ironic/conductor/rpcapi.py')
-rw-r--r-- | ironic/conductor/rpcapi.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ironic/conductor/rpcapi.py b/ironic/conductor/rpcapi.py index c244a6623..b644d8566 100644 --- a/ironic/conductor/rpcapi.py +++ b/ironic/conductor/rpcapi.py @@ -94,13 +94,14 @@ class ConductorAPI(object): | 1.43 - Added do_node_rescue, do_node_unrescue and can_send_rescue | 1.44 - Added add_node_traits and remove_node_traits. | 1.45 - Added continue_node_deploy + | 1.46 - Added reset_interfaces to update_node """ # NOTE(rloo): This must be in sync with manager.ConductorManager's. # NOTE(pas-ha): This also must be in sync with # ironic.common.release_mappings.RELEASE_MAPPING['master'] - RPC_API_VERSION = '1.45' + RPC_API_VERSION = '1.46' def __init__(self, topic=None): super(ConductorAPI, self).__init__() @@ -186,7 +187,8 @@ class ConductorAPI(object): cctxt = self.client.prepare(topic=topic or self.topic, version='1.36') return cctxt.call(context, 'create_node', node_obj=node_obj) - def update_node(self, context, node_obj, topic=None): + def update_node(self, context, node_obj, topic=None, + reset_interfaces=False): """Synchronously, have a conductor update the node's information. Update the node's information in the database and return a node object. @@ -201,13 +203,16 @@ class ConductorAPI(object): :param context: request context. :param node_obj: a changed (but not saved) node object. :param topic: RPC topic. Defaults to self.topic. + :param reset_interfaces: whether to reset hardware interfaces to their + defaults. :returns: updated node object, including all fields. :raises: NoValidDefaultForInterface if no default can be calculated for some interfaces, and explicit values must be provided. """ cctxt = self.client.prepare(topic=topic or self.topic, version='1.1') - return cctxt.call(context, 'update_node', node_obj=node_obj) + return cctxt.call(context, 'update_node', node_obj=node_obj, + reset_interfaces=reset_interfaces) def change_node_power_state(self, context, node_id, new_state, topic=None, timeout=None): |