Переглянути джерело

ftth#40 object ssh updated sending enter command to olt. Related to https://gitlab.com/interlink-sa/flowdat3/modules/ftth/issues/40

Guillermo Espinoza 6 роки тому
батько
коміт
b40fa166b0
1 змінених файлів з 5 додано та 1 видалено
  1. 5 1
      ObjectSsh.py

+ 5 - 1
ObjectSsh.py

@@ -120,7 +120,11 @@ class ObjectSsh(ObjectConnection):
         :param expected: Expected string to stop listening
         """
         self.command_print(command)
-        command = command.rstrip(self.NEW_LINE_WINDOWS).rstrip(self.NEW_LINE_UNIX)
+        if "\\n" in command and len(command) == 4:
+            print "Sendig ENTER \\r\\n"
+            command = '\r\n'
+        else:
+            command = command.rstrip(self.NEW_LINE_WINDOWS).rstrip(self.NEW_LINE_UNIX)
         if not self.command_enable(command) and not self.command_quit(command):
             if command.__len__() > 0:
                 if self.debug: