aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/ssh.py
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python/ssh.py')
-rw-r--r--resources/libraries/python/ssh.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/resources/libraries/python/ssh.py b/resources/libraries/python/ssh.py
index 4beec5aa83..a23d163768 100644
--- a/resources/libraries/python/ssh.py
+++ b/resources/libraries/python/ssh.py
@@ -13,15 +13,17 @@
"""Library for SSH connection management."""
-import paramiko
+
import socket
import StringIO
-from paramiko import RSAKey
+from time import time, sleep
+
+from paramiko import RSAKey, SSHClient, AutoAddPolicy
from paramiko.ssh_exception import SSHException, NoValidConnectionsError
from robot.api import logger
from scp import SCPClient
-from time import time, sleep
+
__all__ = ["exec_cmd", "exec_cmd_no_error"]
@@ -86,8 +88,8 @@ class SSH(object):
pkey = RSAKey.from_private_key(
StringIO.StringIO(node['priv_key']))
- self._ssh = paramiko.SSHClient()
- self._ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
+ self._ssh = SSHClient()
+ self._ssh.set_missing_host_key_policy(AutoAddPolicy())
self._ssh.connect(node['host'], username=node['username'],
password=node.get('password'), pkey=pkey,