提交 960e29dc 编写于 作者: L Lucas Meneghel Rodrigues

Merge pull request #788 from ldoktor/remoter

avocado.core.remoter: Handle fabric NetworkError properly
......@@ -87,10 +87,16 @@ class Remote(object):
"""
result = process.CmdResult()
start_time = time.time()
fabric_result = fabric.operations.run(command=command,
quiet=self.quiet,
warn_only=True,
timeout=timeout)
end_time = time.time() + timeout
# Fabric sometimes returns NetworkError even when timeout not reached
while time.time() < end_time:
try:
fabric_result = fabric.operations.run(command=command,
quiet=self.quiet,
warn_only=True,
timeout=timeout)
except fabric.network.NetworkError:
timeout = end_time - time.time()
end_time = time.time()
duration = end_time - start_time
result.command = command
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册