summaryrefslogtreecommitdiff
path: root/ironic/common/utils.py
diff options
context:
space:
mode:
authorPavlo Shchelokovskyy <pshchelokovskyy@mirantis.com>2017-07-07 18:23:02 +0300
committerPavlo Shchelokovskyy <shchelokovskyy@gmail.com>2017-08-01 12:39:39 +0000
commit3d9895cc0b6b9e41cdc5cc389d10504cd31ffa9d (patch)
tree38bd18e1700e7d4a53645ff2238e40f17985568f /ironic/common/utils.py
parent4ff2120f3b904399f87a3279b54a32a5832e0587 (diff)
downloadironic-3d9895cc0b6b9e41cdc5cc389d10504cd31ffa9d.tar.gz
Remove SSH-based driver interfaces and drivers
SSH drivers are being unsupported for about a year now. All current stable branches of ironic are officially supporting IPMI-capable HW simulation via virtualbmc. All ironic-related gate jobs have already been switched to not use or enable those drivers. This patch finally removes SSH-based power and managemtnt driver interfaces and all classic drivers using those from ironic code and documentation. Related exceptions and `ssh_connect` function, together with dependency on `paramiko` package are removed as well. Change-Id: Ieda7249b9cd78e3be1eff37804996295fc8d3969 Closes-Bug: #1570301 Depends-On: I9b60c9fa24652e9e64e787cd4e5b0152f51e7a28
Diffstat (limited to 'ironic/common/utils.py')
-rw-r--r--ironic/common/utils.py41
1 files changed, 0 insertions, 41 deletions
diff --git a/ironic/common/utils.py b/ironic/common/utils.py
index c6085d74e..963e1d2f8 100644
--- a/ironic/common/utils.py
+++ b/ironic/common/utils.py
@@ -32,7 +32,6 @@ from oslo_concurrency import processutils
from oslo_log import log as logging
from oslo_utils import netutils
from oslo_utils import timeutils
-import paramiko
import pytz
import six
@@ -79,46 +78,6 @@ def execute(*cmd, **kwargs):
return result
-def ssh_connect(connection):
- """Method to connect to a remote system using ssh protocol.
-
- :param connection: a dict of connection parameters.
- :returns: paramiko.SSHClient -- an active ssh connection.
- :raises: SSHConnectFailed
-
- """
- try:
- ssh = paramiko.SSHClient()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- key_contents = connection.get('key_contents')
- if key_contents:
- data = six.StringIO(key_contents)
- if "BEGIN RSA PRIVATE" in key_contents:
- pkey = paramiko.RSAKey.from_private_key(data)
- elif "BEGIN DSA PRIVATE" in key_contents:
- pkey = paramiko.DSSKey.from_private_key(data)
- else:
- # Can't include the key contents - secure material.
- raise ValueError(_("Invalid private key"))
- else:
- pkey = None
- ssh.connect(connection.get('host'),
- username=connection.get('username'),
- password=connection.get('password'),
- port=connection.get('port', 22),
- pkey=pkey,
- key_filename=connection.get('key_filename'),
- timeout=connection.get('timeout', 10))
-
- # send TCP keepalive packets every 20 seconds
- ssh.get_transport().set_keepalive(20)
- except Exception as e:
- LOG.debug("SSH connect failed: %s", e)
- raise exception.SSHConnectFailed(host=connection.get('host'))
-
- return ssh
-
-
def is_valid_datapath_id(datapath_id):
"""Verify the format of an OpenFlow datapath_id.