Ver Fonte

Merge branch 'master' of ssh://gitlab.com/interlink-sa/flowdat3/modules/connect

gabriel há 6 anos atrás
pai
commit
9e9d8ad8d1
2 ficheiros alterados com 8 adições e 0 exclusões
  1. 4 0
      ObjectSsh.py
  2. 4 0
      ObjectTelnet.py

+ 4 - 0
ObjectSsh.py

@@ -50,8 +50,12 @@ class ObjectSsh(ObjectConnection):
             self.connection_data()
         else:
             self.connection_old()
+        nc = 0
         while self.QUIT:
+            if nc == 20:
+                self.QUIT = False
             # send quit to terminal until exit confirmation
+            nc += 1
             self.command_quit(self.olt.get_write_exit())
         self.stdin.close()
         self.stdout.close()

+ 4 - 0
ObjectTelnet.py

@@ -58,9 +58,13 @@ class ObjectTelnet(ObjectConnection):
                     else:
                         self.connection_old()
                     print("fin-----")
+                    nc = 0
                     while self.QUIT:
+                        if nc == 20:
+                            self.QUIT = False
                         # send quit to terminal until exit confirmation
                         self.command_quit(self.olt.get_write_exit())
+                        contador += 1
                     self.tn.close()
                     self.save_log()
                     exit(self.RUN_OK)