From: John Spray Date: Mon, 5 Sep 2016 10:17:04 +0000 (+0100) Subject: orchestra.run: fix generating ConnectionLostError X-Git-Tag: 1.1.0~536^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d3b05e759da29e5b17cabfbc2d9346cb93a9ae8b;p=teuthology.git 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 --- 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)