]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
orchestra.run: fix generating ConnectionLostError 950/head
authorJohn Spray <john.spray@redhat.com>
Mon, 5 Sep 2016 10:17:04 +0000 (11:17 +0100)
committerJohn Spray <john.spray@redhat.com>
Mon, 5 Sep 2016 10:17:04 +0000 (11:17 +0100)
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 <john.spray@redhat.com>
teuthology/orchestra/run.py

index 43c9eb8ece702c9b66ef359bfa1f496f53f1dfa9..cccb8d38970b91fadee92f042182ab397858b532 100644 (file)
@@ -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)