From d3b05e759da29e5b17cabfbc2d9346cb93a9ae8b Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 5 Sep 2016 11:17:04 +0100 Subject: [PATCH] orchestra.run: fix generating ConnectionLostError Previously you could get AttributeError if a node went away, because it tried to call getpeername after get_transport() had returned None. Signed-off-by: John Spray --- teuthology/orchestra/run.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/teuthology/orchestra/run.py b/teuthology/orchestra/run.py index 43c9eb8ec..cccb8d389 100644 --- a/teuthology/orchestra/run.py +++ b/teuthology/orchestra/run.py @@ -380,7 +380,11 @@ def run( paramiko """ try: - (host, port) = client.get_transport().getpeername() + transport = client.get_transport() + if transport: + (host, port) = transport.getpeername() + else: + raise ConnectionLostError(command=quote(args), node=name) except socket.error: raise ConnectionLostError(command=quote(args), node=name) -- 2.47.3