From a43d615e18d0ed0a5218a99b50c11d0d7b566242 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Wed, 14 May 2025 09:01:03 -0700 Subject: [PATCH] trivial: add missing exception to agent code path docstrings While investigating https://bugs.launchpad.net/ironic/+bug/2110698 I noticed you could end up with an additional exception raised which would be considered a hard failure. Overall, the code path looks okay for it, its just not in the doc strings, so I figured easy enough to fix it. Change-Id: I528b6f327fac95cdb8b620843c073fc9cdec1833 --- ironic/drivers/modules/agent_base.py | 1 + ironic/drivers/modules/agent_client.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ironic/drivers/modules/agent_base.py b/ironic/drivers/modules/agent_base.py index a5cae441da..7bcdecb345 100644 --- a/ironic/drivers/modules/agent_base.py +++ b/ironic/drivers/modules/agent_base.py @@ -545,6 +545,7 @@ class HeartbeatMixin(object): LOG.exception('Asynchronous exception for node %(node)s: %(err)s', {'node': task.node.uuid, 'err': last_error}) # Do not call the error handler is the node is already DEPLOYFAIL + # or DEPLOYWAIT if node.provision_state in (states.DEPLOYING, states.DEPLOYWAIT): deploy_utils.set_failed_state( task, last_error, collect_logs=self.collect_deploy_logs) diff --git a/ironic/drivers/modules/agent_client.py b/ironic/drivers/modules/agent_client.py index c4cb312e9e..e6b9e7c268 100644 --- a/ironic/drivers/modules/agent_client.py +++ b/ironic/drivers/modules/agent_client.py @@ -183,6 +183,8 @@ class AgentClient(object): :raises: AgentAPIError when agent failed to execute specified command. :raises: AgentInProgress when the command fails to execute as the agent is presently executing the prior command. + :raises: AgentConnectionFailed when connectivity has failed and there + is no prior command to determine the status of. :returns: A dict containing command result from agent, see get_commands_status for a sample. """ @@ -577,6 +579,8 @@ class AgentClient(object): :raises: IronicException when failed to issue the request or there was a malformed response from the agent. :raises: AgentAPIError when agent failed to execute specified command. + :raises: AgentConnectionFailed when an a transient connection failure + breaks the connection while the request is being processed. :returns: A dict containing command response from agent. See :func:`get_commands_status` for a command result sample. The value of key command_result is in the form of: