Explorar el Código

Try and be a bet better about timeouts.

Joe Clarke hace 4 años
padre
commit
d52deb92d7
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      automation/network/diff-route-tables.py

+ 3 - 1
automation/network/diff-route-tables.py

@@ -88,14 +88,16 @@ if __name__ == "__main__":
                 output = ""
                 try:
                     chan.sendall("term length 0\n")
+                    time.sleep(0.5)
                     chan.sendall("term width 0\n")
+                    time.sleep(0.5)
                     chan.sendall("{}\n".format(command))
                     i = 0
                     while i < 10:
                         if chan.recv_ready():
                             break
-                        time.sleep(0.5)
                         i += 1
+                        time.sleep(i * 0.5)
                     while chan.recv_ready():
                         output = output + chan.recv(131070).decode("utf-8")
                 except Exception as ie: