Revision: 100
Author: janne.t.harkonen
Date: Sun Nov 7 23:18:35 2010
Log: IOException is raised when key file is invalid
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=100
Modified:
/trunk/src/SSHLibrary/__init__.py
/trunk/src/SSHLibrary/javaclient.py
=======================================
--- /trunk/src/SSHLibrary/__init__.py Wed Nov 3 06:58:13 2010
+++ /trunk/src/SSHLibrary/__init__.py Sun Nov 7 23:18:35 2010
@@ -515,7 +515,7 @@
When wild cards are used, destination MUST be a directory and only
files
are copied from the src, sub directories are ignored. If the
contents
of sub directories are also needed, use the keyword again.
-
+
Default file permission is 0744 (-rwxr--r--) and can be changed by
giving a value to the optional `mode` parameter.
=======================================
--- /trunk/src/SSHLibrary/javaclient.py Wed Nov 3 06:50:34 2010
+++ /trunk/src/SSHLibrary/javaclient.py Sun Nov 7 23:18:35 2010
@@ -37,7 +37,11 @@
raise AuthenticationException("Authentication failed for
user: %s" % username)
def login_with_public_key(self, username, key, password):
- if not self.client.authenticateWithPublicKey(username, File(key),
password):
+ try:
+ if not self.client.authenticateWithPublicKey(username,
File(key), password):
+ raise AuthenticationException()
+ except IOError:
+ # IOError is raised also when key file is invalid
raise AuthenticationException()
def close(self):