From 7dc74ab75478318afc5c933472423f4c77eb662d Mon Sep 17 00:00:00 2001 From: Mario Villaplana Date: Mon, 26 Sep 2016 17:48:58 +0000 Subject: [PATCH] Remove "agent_last_heartbeat" internal field from agent drivers "agent_last_heartbeat" in the driver_internal_info dict of agent drivers is not used anywhere by ironic itself, except for logging purposes. This removes it. Change-Id: Ic198f6a952ed135099bcc525ef548a4aea005056 Closes-Bug: 1602410 --- doc/source/dev/code-contribution-guide.rst | 1 - ironic/drivers/modules/agent_base_vendor.py | 7 +------ .../remove-agent_last_heartbeat-65a9fe02f20465c5.yaml | 4 ++++ 3 files changed, 5 insertions(+), 7 deletions(-) create mode 100644 releasenotes/notes/remove-agent_last_heartbeat-65a9fe02f20465c5.yaml diff --git a/doc/source/dev/code-contribution-guide.rst b/doc/source/dev/code-contribution-guide.rst index 5ef5fcd815..9dd0ace4fa 100644 --- a/doc/source/dev/code-contribution-guide.rst +++ b/doc/source/dev/code-contribution-guide.rst @@ -201,7 +201,6 @@ Common attributes: Agent driver attributes: * ``agent_url``: A String value of IPA API URL so that Ironic can talk to IPA ramdisk. - * ``agent_last_heartbeat``: An Integer value of the last agent heartbeat time. * ``hardware_manager_version``: A String value of the version of the hardware manager in IPA ramdisk. * ``target_raid_config``: A Dictionary containing the target RAID configuration. This is a copy of the same name attribute in Node object. But this one is never actually saved into DB and is only diff --git a/ironic/drivers/modules/agent_base_vendor.py b/ironic/drivers/modules/agent_base_vendor.py index ed0e2bf53b..bdac557e2e 100644 --- a/ironic/drivers/modules/agent_base_vendor.py +++ b/ironic/drivers/modules/agent_base_vendor.py @@ -17,7 +17,6 @@ # under the License. import collections -import time from ironic_lib import metrics_utils from oslo_log import log @@ -452,11 +451,7 @@ class AgentDeployMixin(object): node = task.node driver_internal_info = node.driver_internal_info - LOG.debug( - 'Heartbeat from %(node)s, last heartbeat at %(heartbeat)s.', - {'node': node.uuid, - 'heartbeat': driver_internal_info.get('agent_last_heartbeat')}) - driver_internal_info['agent_last_heartbeat'] = int(time.time()) + LOG.debug('Heartbeat from node %s' % node.uuid) driver_internal_info['agent_url'] = callback_url node.driver_internal_info = driver_internal_info diff --git a/releasenotes/notes/remove-agent_last_heartbeat-65a9fe02f20465c5.yaml b/releasenotes/notes/remove-agent_last_heartbeat-65a9fe02f20465c5.yaml new file mode 100644 index 0000000000..37f7be0740 --- /dev/null +++ b/releasenotes/notes/remove-agent_last_heartbeat-65a9fe02f20465c5.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - The ``agent_last_heartbeat`` field of ``driver_internal_info`` has been + removed from all agent drivers, since this field was unused by ironic.