Skip to content
Snippets Groups Projects
Commit 1abb4890 authored by Mads M. Pedersen's avatar Mads M. Pedersen
Browse files

Ssh update

parent 70728569
No related branches found
No related tags found
No related merge requests found
Pipeline #7516 passed
......@@ -117,7 +117,8 @@ class SSHClient(object):
self.counter_lock = threading.RLock()
self.counter = 0
if key is not None:
self.key = paramiko.RSAKey.from_private_key(StringIO(key), password=passphrase)
with open(key) as fid:
self.key = paramiko.RSAKey.from_private_key(fid, password=passphrase)
def info(self):
return self.host, self.username, self.password, self.port
......@@ -164,7 +165,7 @@ class SSHClient(object):
self.client.connect("127.0.0.1", 10022, username=self.username, password=self.password)
print("done")
elif self.password is None or self.password == "":
elif self.key is None and (self.password is None or self.password == ""):
raise IOError("Password not set for %s" % self.host)
else:
self.client = paramiko.SSHClient()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment