robey/paramiko — Issue #45: set_missing_host_key_policy crashes
Author: bortzmeyer
Created: 2011-10-13 13:07:22+00:00
State: open

I tried to use the example in the code samples, to deal with unknown hosts:

client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.WarningPolicy)
client.connect("192.168.2.26")

But it fails:

Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/pymodules/python2.6/paramiko/client.py", line 311, in connect
self._policy.missing_host_key(self, server_hostkey_name, server_key)
TypeError: unbound method missing_host_key() must be called with WarningPolicy instance as first argument (got SSHClient instance instead)

This is on Debian "squeeze", the stable version.

Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5] on linux2

Paramiko 1.7.6