Revision 78062de9

b/INSTALL
41 41
  python 2.4 (optional, used for node daemon memory locking)
42 42
- `socat <http://www.dest-unreach.org/socat/>`_, see :ref:`note
43 43
  <socat-note>` below
44
- `Paramiko <http://www.lag.net/paramiko/>`_, if you want automated SSH
45
  setup; optional otherwise but manual setup of the nodes required
44
- `Paramiko <http://www.lag.net/paramiko/>`_, if you want to use
45
  ``ganeti-listrunner``
46 46
- `affinity Python module <http://pypi.python.org/pypi/affinity/0.1.0>`_,
47 47
  optional python package for supporting CPU pinning under KVM
48 48
- `ElementTree Python module <http://effbot.org/zone/element-index.htm>`_,
b/configure.ac
663 663
AC_PYTHON_MODULE(pyinotify, t)
664 664
AC_PYTHON_MODULE(pycurl, t)
665 665
AC_PYTHON_MODULE(affinity)
666

  
667
# This is optional but then we've limited functionality
668 666
AC_PYTHON_MODULE(paramiko)
669
if test "$HAVE_PYMOD_PARAMIKO" = "no"; then
670
  AC_MSG_WARN(m4_normalize([You do not have Paramiko installed. While this is
671
                            optional you have to configure SSH and the node
672
                            daemon on the joining nodes yourself.]))
673
fi
674 667

  
675 668
AC_CONFIG_FILES([ Makefile ])
676 669

  
b/lib/ssh.py
26 26

  
27 27
import os
28 28
import logging
29
import re
30 29

  
31 30
from ganeti import utils
32 31
from ganeti import errors
......
37 36
from ganeti import compat
38 37

  
39 38

  
40
def FormatParamikoFingerprint(fingerprint):
41
  """Format paramiko PKey fingerprint.
42

  
43
  @type fingerprint: str
44
  @param fingerprint: PKey fingerprint
45
  @return: The string hex representation of the fingerprint
46

  
47
  """
48
  assert len(fingerprint) % 2 == 0
49
  return ":".join(re.findall(r"..", fingerprint.lower()))
50

  
51

  
52 39
def GetUserFiles(user, mkdir=False, dircheck=True, kind=constants.SSHK_DSA,
53 40
                 _homedir_fn=None):
54 41
  """Return the paths of a user's SSH files.
b/test/ganeti.ssh_unittest.py
49 49
        "%s ssh-rsa %s\n" % (cfg.GetClusterName(),
50 50
                             mocks.FAKE_CLUSTER_KEY))
51 51

  
52
  def testFormatParamikoFingerprintCorrect(self):
53
    self.assertEqual(ssh.FormatParamikoFingerprint("C0Ffee"), "c0:ff:ee")
54

  
55
  def testFormatParamikoFingerprintNotDividableByTwo(self):
56
    self.assertRaises(AssertionError, ssh.FormatParamikoFingerprint, "C0Ffe")
57

  
58 52

  
59 53
class TestGetUserFiles(unittest.TestCase):
60 54
  def setUp(self):
b/tools/ganeti-listrunner
64 64
import time
65 65
import traceback
66 66

  
67
import paramiko
67
try:
68
  import paramiko
69
except ImportError:
70
  print >> sys.stderr, \
71
    ("The \"paramiko\" module could not be imported. Install it from your"
72
     " distribution's repository. The package is usually named"
73
     " \"python-paramiko\".")
74
  sys.exit(1)
68 75

  
69 76

  
70 77
REMOTE_PATH_BASE = "/tmp/listrunner"

Also available in: Unified diff