Commit 78062de9 authored by Michael Hanselmann's avatar Michael Hanselmann

Make Paramiko an optional dependency for listrunner

With the move away from “setup-ssh”, Paramiko is no longer necessary to
configure SSH on nodes.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 8a670753
......@@ -41,8 +41,8 @@ Before installing, please verify that you have the following programs:
python 2.4 (optional, used for node daemon memory locking)
- `socat <http://www.dest-unreach.org/socat/>`_, see :ref:`note
<socat-note>` below
- `Paramiko <http://www.lag.net/paramiko/>`_, if you want automated SSH
setup; optional otherwise but manual setup of the nodes required
- `Paramiko <http://www.lag.net/paramiko/>`_, if you want to use
``ganeti-listrunner``
- `affinity Python module <http://pypi.python.org/pypi/affinity/0.1.0>`_,
optional python package for supporting CPU pinning under KVM
- `ElementTree Python module <http://effbot.org/zone/element-index.htm>`_,
......
......@@ -663,14 +663,7 @@ AC_PYTHON_MODULE(pyparsing, t)
AC_PYTHON_MODULE(pyinotify, t)
AC_PYTHON_MODULE(pycurl, t)
AC_PYTHON_MODULE(affinity)
# This is optional but then we've limited functionality
AC_PYTHON_MODULE(paramiko)
if test "$HAVE_PYMOD_PARAMIKO" = "no"; then
AC_MSG_WARN(m4_normalize([You do not have Paramiko installed. While this is
optional you have to configure SSH and the node
daemon on the joining nodes yourself.]))
fi
AC_CONFIG_FILES([ Makefile ])
......
......@@ -26,7 +26,6 @@
import os
import logging
import re
from ganeti import utils
from ganeti import errors
......@@ -37,18 +36,6 @@ from ganeti import vcluster
from ganeti import compat
def FormatParamikoFingerprint(fingerprint):
"""Format paramiko PKey fingerprint.
@type fingerprint: str
@param fingerprint: PKey fingerprint
@return: The string hex representation of the fingerprint
"""
assert len(fingerprint) % 2 == 0
return ":".join(re.findall(r"..", fingerprint.lower()))
def GetUserFiles(user, mkdir=False, dircheck=True, kind=constants.SSHK_DSA,
_homedir_fn=None):
"""Return the paths of a user's SSH files.
......
......@@ -49,12 +49,6 @@ class TestKnownHosts(testutils.GanetiTestCase):
"%s ssh-rsa %s\n" % (cfg.GetClusterName(),
mocks.FAKE_CLUSTER_KEY))
def testFormatParamikoFingerprintCorrect(self):
self.assertEqual(ssh.FormatParamikoFingerprint("C0Ffee"), "c0:ff:ee")
def testFormatParamikoFingerprintNotDividableByTwo(self):
self.assertRaises(AssertionError, ssh.FormatParamikoFingerprint, "C0Ffe")
class TestGetUserFiles(unittest.TestCase):
def setUp(self):
......
......@@ -64,7 +64,14 @@ import sys
import time
import traceback
import paramiko
try:
import paramiko
except ImportError:
print >> sys.stderr, \
("The \"paramiko\" module could not be imported. Install it from your"
" distribution's repository. The package is usually named"
" \"python-paramiko\".")
sys.exit(1)
REMOTE_PATH_BASE = "/tmp/listrunner"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment