Merge "Trivial: clarify usage of AgentCommandTimeout in _wait_for_command"

This commit is contained in:
Zuul 2020-06-24 21:34:09 +00:00 committed by Gerrit Code Review
commit c4092b27bd
1 changed files with 5 additions and 0 deletions

View File

@ -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)