From 130f96d9d0a5efa906fd386908c8e2f4431755e4 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Tue, 23 Jun 2020 13:59:17 +0200 Subject: [PATCH] Trivial: clarify usage of AgentCommandTimeout in _wait_for_command A follow-up to commit 7828fe8b64c0681727c8b09bfd0af8452ad93645. Change-Id: Ic55795b307e24d650c14a8ae0fd4f65ea7804852 --- ironic/drivers/modules/agent_client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ironic/drivers/modules/agent_client.py b/ironic/drivers/modules/agent_client.py index 74f03cc2f6..59d1aa2034 100644 --- a/ironic/drivers/modules/agent_client.py +++ b/ironic/drivers/modules/agent_client.py @@ -77,12 +77,17 @@ class AgentClient(object): :param node: A Node object. :param method: A string represents the command executed by agent. + :raises: AgentCommandTimeout if timeout is reached. """ try: method = method.split('.', 1)[1] except IndexError: pass + # NOTE(dtantsur): this function uses AgentCommandTimeout on every + # failure, but unless the timeout is reached, the exception is caught + # and retried by the @retry decorator above. + commands = self.get_commands_status(node) try: result = next(c for c in reversed(commands)