Revision: 81
Author: janne.t.harkonen
Date: Mon Nov 30 23:42:23 2009
Log: Open shell if not opened also with Read* keywords.

Patch sent by Mika Batsman, thanks!
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=81

Modified:
 /trunk/src/SSHLibrary/__init__.py

=======================================
--- /trunk/src/SSHLibrary/__init__.py   Fri Feb 27 02:42:41 2009
+++ /trunk/src/SSHLibrary/__init__.py   Mon Nov 30 23:42:23 2009
@@ -367,6 +367,8 @@
`loglevel` can be used to override the default log level, and available
         levels are TRACE, DEBUG, INFO and WARN.
         """
+        if self._client.shell is None:
+            self._client.open_shell()
         ret = self._client.read()
         self._log(ret, loglevel)
         return ret
@@ -385,6 +387,8 @@
         return self._read_until(expected, loglevel)

     def _read_until(self, expected, loglevel):
+        if self._client.shell is None:
+            self._client.open_shell()
         ret = ''
         start_time = time.time()
         while time.time() < float(self._timeout) + start_time:

Reply via email to