summaryrefslogtreecommitdiff
path: root/ironic/conductor/rpcapi.py
diff options
context:
space:
mode:
authorSam Betts <sam@code-smash.net>2016-09-02 12:45:26 +0100
committerSam Betts <sam@code-smash.net>2017-12-11 16:25:47 +0000
commitb642f28be49f31693772231ee921ecfdbd7c80b9 (patch)
tree3660d2932785cc4f90abddc922abc08850cc5061 /ironic/conductor/rpcapi.py
parent5f563d924c0214500a043068ac03c5fa90c88454 (diff)
downloadironic-b642f28be49f31693772231ee921ecfdbd7c80b9.tar.gz
Receive and store agent version on heartbeat
This patch enables receiving agent_version as part of heartbeat, and stores this information on driver_internal_info. This is so that Ironic can dynamically adjust which features and parameters it uses based on which version of the agent is being used. Change-Id: I400adba5d908b657751a83971811e8586f46c673 Partial-Bug: #1602265
Diffstat (limited to 'ironic/conductor/rpcapi.py')
-rw-r--r--ironic/conductor/rpcapi.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/ironic/conductor/rpcapi.py b/ironic/conductor/rpcapi.py
index 410864125..6563ce10f 100644
--- a/ironic/conductor/rpcapi.py
+++ b/ironic/conductor/rpcapi.py
@@ -90,13 +90,14 @@ class ConductorAPI(object):
| 1.39 - Added timeout optional parameter to change_node_power_state
| 1.40 - Added inject_nmi
| 1.41 - Added create_port
+ | 1.42 - Added optional agent_version to heartbeat
"""
# 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.41'
+ RPC_API_VERSION = '1.42'
def __init__(self, topic=None):
super(ConductorAPI, self).__init__()
@@ -744,17 +745,24 @@ class ConductorAPI(object):
return cctxt.call(context, 'do_node_clean',
node_id=node_id, clean_steps=clean_steps)
- def heartbeat(self, context, node_id, callback_url, topic=None):
+ def heartbeat(self, context, node_id, callback_url, agent_version,
+ topic=None):
"""Process a node heartbeat.
:param context: request context.
:param node_id: node ID or UUID.
:param callback_url: URL to reach back to the ramdisk.
:param topic: RPC topic. Defaults to self.topic.
+ :param agent_version: the version of the agent that is heartbeating
"""
- cctxt = self.client.prepare(topic=topic or self.topic, version='1.34')
+ new_kws = {}
+ version = '1.34'
+ if self.client.can_send_version('1.42'):
+ version = '1.42'
+ new_kws['agent_version'] = agent_version
+ cctxt = self.client.prepare(topic=topic or self.topic, version=version)
return cctxt.call(context, 'heartbeat', node_id=node_id,
- callback_url=callback_url)
+ callback_url=callback_url, **new_kws)
def object_class_action_versions(self, context, objname, objmethod,
object_versions, args, kwargs):