From effdcd741af65d93090ffeb4f0f94a935969e9c3 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Tue, 31 Dec 2013 19:10:08 -0800 Subject: [PATCH 01/14] New year --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 1899819..9f68d37 100644 --- a/README +++ b/README @@ -5,7 +5,7 @@ paramiko :Paramiko: Python SSH module :Copyright: Copyright (c) 2003-2009 Robey Pointer -:Copyright: Copyright (c) 2013 Jeff Forcier +:Copyright: Copyright (c) 2014 Jeff Forcier :License: LGPL :Homepage: https://github.com/paramiko/paramiko/ :API docs: http://docs.paramiko.org From 91a80666864f453cb1786edbec99376afbc84538 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Tue, 31 Dec 2013 19:14:36 -0800 Subject: [PATCH 02/14] No more Python 2.5 on Travis :( --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 43a4279..ce7acc5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: python python: - - "2.5" - "2.6" - "2.7" install: From c695a931ff93605668001526643cb2cad12e8e2b Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Tue, 31 Dec 2013 19:24:10 -0800 Subject: [PATCH 03/14] Update travis settings to be similar to fab's --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index ce7acc5..88b6993 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,5 +9,9 @@ script: python test.py --verbose notifications: irc: channels: "irc.freenode.org#paramiko" + template: + - "%{repository}@%{branch}: %{message} (%{build_url})" on_success: change on_failure: change + use_notice: true + email: false From bfc3953be000e426551c90d65a0633c62c9fde89 Mon Sep 17 00:00:00 2001 From: Martin Blumenstingl Date: Tue, 7 Jan 2014 22:36:28 +0100 Subject: [PATCH 04/14] Add a testcase for client.save_host_keys. --- tests/test_client.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/test_client.py b/tests/test_client.py index e535227..7aaa1bf 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -25,6 +25,8 @@ import threading import time import unittest import weakref +import warnings +import os from binascii import hexlify import paramiko @@ -184,7 +186,29 @@ class SSHClientTest (unittest.TestCase): self.assertEquals(1, len(self.tc.get_host_keys())) self.assertEquals(public_host_key, self.tc.get_host_keys()['[%s]:%d' % (self.addr, self.port)]['ssh-rsa']) - def test_5_cleanup(self): + def test_5_save_host_keys(self): + """ + verify that SSHClient correctly saves a known_hosts file. + """ + warnings.filterwarnings('ignore', 'tempnam.*') + + host_key = paramiko.RSAKey.from_private_key_file('tests/test_rsa.key') + public_host_key = paramiko.RSAKey(data=str(host_key)) + localname = os.tempnam() + + self.tc = paramiko.SSHClient() + self.assertEquals(0, len(self.tc.get_host_keys())) + + self.tc.get_host_keys().add('[%s]:%d' % (self.addr, self.port), 'ssh-rsa', public_host_key) + self.assertEquals(1, len(self.tc.get_host_keys())) + self.assertEquals(public_host_key, self.tc.get_host_keys()['[%s]:%d' % (self.addr, self.port)]['ssh-rsa']) + + self.tc.save_host_keys(localname) + self.assertEquals(len('[%s]:%d' % (self.addr, self.port)) + 210, os.path.getsize(localname)) + + os.unlink(localname) + + def test_6_cleanup(self): """ verify that when an SSHClient is collected, its transport (and the transport's packetizer) is closed. From 78d9e4834cb9e4bb0060b419c8677660b016f4d2 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 8 Jan 2014 12:35:46 -0800 Subject: [PATCH 05/14] No need for 'self.tc' within a single test :) --- tests/test_client.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 7aaa1bf..7be2d73 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -196,14 +196,14 @@ class SSHClientTest (unittest.TestCase): public_host_key = paramiko.RSAKey(data=str(host_key)) localname = os.tempnam() - self.tc = paramiko.SSHClient() - self.assertEquals(0, len(self.tc.get_host_keys())) + client = paramiko.SSHClient() + self.assertEquals(0, len(client.get_host_keys())) - self.tc.get_host_keys().add('[%s]:%d' % (self.addr, self.port), 'ssh-rsa', public_host_key) - self.assertEquals(1, len(self.tc.get_host_keys())) - self.assertEquals(public_host_key, self.tc.get_host_keys()['[%s]:%d' % (self.addr, self.port)]['ssh-rsa']) + client.get_host_keys().add('[%s]:%d' % (self.addr, self.port), 'ssh-rsa', public_host_key) + self.assertEquals(1, len(client.get_host_keys())) + self.assertEquals(public_host_key, client.get_host_keys()['[%s]:%d' % (self.addr, self.port)]['ssh-rsa']) - self.tc.save_host_keys(localname) + client.save_host_keys(localname) self.assertEquals(len('[%s]:%d' % (self.addr, self.port)) + 210, os.path.getsize(localname)) os.unlink(localname) From 74e06aff9e1869dece030b61e99365150fb2e315 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 8 Jan 2014 12:39:11 -0800 Subject: [PATCH 06/14] Small refactor --- tests/test_client.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 7be2d73..ad80e72 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -199,12 +199,14 @@ class SSHClientTest (unittest.TestCase): client = paramiko.SSHClient() self.assertEquals(0, len(client.get_host_keys())) - client.get_host_keys().add('[%s]:%d' % (self.addr, self.port), 'ssh-rsa', public_host_key) + host_id = '[%s]:%d' % (self.addr, self.port) + + client.get_host_keys().add(host_id, 'ssh-rsa', public_host_key) self.assertEquals(1, len(client.get_host_keys())) - self.assertEquals(public_host_key, client.get_host_keys()['[%s]:%d' % (self.addr, self.port)]['ssh-rsa']) + self.assertEquals(public_host_key, client.get_host_keys()[host_id]['ssh-rsa']) client.save_host_keys(localname) - self.assertEquals(len('[%s]:%d' % (self.addr, self.port)) + 210, os.path.getsize(localname)) + self.assertEquals(len(host_id) + 210, os.path.getsize(localname)) os.unlink(localname) From 6d326fcde20dece926c2cf661991590e20a00eab Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 8 Jan 2014 12:44:12 -0800 Subject: [PATCH 07/14] Saner (to me) positive assertion --- tests/test_client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_client.py b/tests/test_client.py index ad80e72..fae1d32 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -20,6 +20,7 @@ Some unit tests for SSHClient. """ +from __future__ import with_statement # Python 2.5 support import socket import threading import time @@ -206,7 +207,9 @@ class SSHClientTest (unittest.TestCase): self.assertEquals(public_host_key, client.get_host_keys()[host_id]['ssh-rsa']) client.save_host_keys(localname) - self.assertEquals(len(host_id) + 210, os.path.getsize(localname)) + + with open(localname) as fd: + assert host_id in fd.read() os.unlink(localname) From a1c1f8f29f3c24e9f34a76e3f5efc57e62396cd8 Mon Sep 17 00:00:00 2001 From: Nathan Scowcroft Date: Thu, 13 Jun 2013 13:05:11 -0400 Subject: [PATCH 08/14] Check correct stored hosts filename. --- paramiko/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paramiko/client.py b/paramiko/client.py index c5a2d1a..4adcfe7 100644 --- a/paramiko/client.py +++ b/paramiko/client.py @@ -189,8 +189,8 @@ class SSHClient (object): # update local host keys from file (in case other SSH clients # have written to the known_hosts file meanwhile. - if self.known_hosts is not None: - self.load_host_keys(self.known_hosts) + if self._host_keys_filename is not None: + self.load_host_keys(self._known_keys_filename) f = open(filename, 'w') for hostname, keys in self._host_keys.iteritems(): From 0fea895cdb1e69737f3526bad02e533e99b0bfe0 Mon Sep 17 00:00:00 2001 From: Nathan Scowcroft Date: Mon, 24 Jun 2013 16:43:12 -0400 Subject: [PATCH 09/14] ditto --- paramiko/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paramiko/client.py b/paramiko/client.py index 4adcfe7..be89609 100644 --- a/paramiko/client.py +++ b/paramiko/client.py @@ -190,7 +190,7 @@ class SSHClient (object): # update local host keys from file (in case other SSH clients # have written to the known_hosts file meanwhile. if self._host_keys_filename is not None: - self.load_host_keys(self._known_keys_filename) + self.load_host_keys(self._host_keys_filename) f = open(filename, 'w') for hostname, keys in self._host_keys.iteritems(): From b57e825f77544a88eea77cf65bbe7d2d0426d4c9 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 8 Jan 2014 12:49:27 -0800 Subject: [PATCH 10/14] Changelog, fixes #176 --- NEWS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS b/NEWS index f3d00dd..2b48ba6 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,13 @@ Issues noted as "Fabric #NN" can be found at https://github.com/fabric/fabric/. Releases ======== +v1.10.5 (8th Jan 2014) +---------------------- + +* #176: Fix AttributeError bugs in known_hosts file (re)loading. Thanks to + Nathan Scowcroft for the patch & Martin Blumenstingl for the initial test + case. + v1.10.4 (27th Sep 2013) ----------------------- From 566f37c0f2f34e89ff1533d9d3f251bc10619b45 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 8 Jan 2014 16:29:56 -0800 Subject: [PATCH 11/14] ecdsa in README; fixes #225 --- NEWS | 2 ++ README | 1 + 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 480b2cb..c2d450b 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,8 @@ v1.12.1 (8th Jan 2014) * #176: Fix AttributeError bugs in known_hosts file (re)loading. Thanks to Nathan Scowcroft for the patch & Martin Blumenstingl for the initial test case. +* #225: Note ecdsa requirement in README. Thanks to Amaury Rodriguez for the + catch. v1.11.3 (8th Jan 2014) ---------------------- diff --git a/README b/README index 1899819..2a23e28 100644 --- a/README +++ b/README @@ -36,6 +36,7 @@ Requirements - python 2.5 or better - pycrypto 2.1 or better + - ecdsa 0.9 or better If you have setuptools, you can build and install paramiko and all its dependencies with this command (as root):: From 698adf10fb68330e1439b60afe9d305014395a68 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 8 Jan 2014 16:40:11 -0800 Subject: [PATCH 12/14] Cut 1.10.5 --- paramiko/__init__.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paramiko/__init__.py b/paramiko/__init__.py index b2e1c03..924e8bb 100644 --- a/paramiko/__init__.py +++ b/paramiko/__init__.py @@ -55,7 +55,7 @@ if sys.version_info < (2, 5): __author__ = "Jeff Forcier " -__version__ = "1.10.4" +__version__ = "1.10.5" __version_info__ = tuple([ int(d) for d in __version__.split(".") ]) __license__ = "GNU Lesser General Public License (LGPL)" diff --git a/setup.py b/setup.py index 0202a70..8ec4a0e 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ if sys.platform == 'darwin': setup(name = "paramiko", - version = "1.10.4", + version = "1.10.5", description = "SSH2 protocol library", author = "Jeff Forcier", author_email = "jeff@bitprophet.org", From 1ff3db96f65c52df416548e8a8047b3c07bcf683 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 8 Jan 2014 16:41:04 -0800 Subject: [PATCH 13/14] Cut 1.11.3 --- paramiko/__init__.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paramiko/__init__.py b/paramiko/__init__.py index be64dde..de89e08 100644 --- a/paramiko/__init__.py +++ b/paramiko/__init__.py @@ -57,7 +57,7 @@ if sys.version_info < (2, 5): __author__ = "Jeff Forcier " -__version__ = "1.11.2" +__version__ = "1.11.3" __version_info__ = tuple([ int(d) for d in __version__.split(".") ]) __license__ = "GNU Lesser General Public License (LGPL)" diff --git a/setup.py b/setup.py index 529ed89..3307500 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ if sys.platform == 'darwin': setup(name = "paramiko", - version = "1.11.2", + version = "1.11.3", description = "SSH2 protocol library", author = "Jeff Forcier", author_email = "jeff@bitprophet.org", From 6ecde066fcd0a23238e8b8929c4e1bef48618df1 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 8 Jan 2014 16:41:44 -0800 Subject: [PATCH 14/14] Cut 1.12.1 --- paramiko/__init__.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paramiko/__init__.py b/paramiko/__init__.py index 32ccfcd..c996302 100644 --- a/paramiko/__init__.py +++ b/paramiko/__init__.py @@ -57,7 +57,7 @@ if sys.version_info < (2, 5): __author__ = "Jeff Forcier " -__version__ = "1.12.0" +__version__ = "1.12.1" __version_info__ = tuple([ int(d) for d in __version__.split(".") ]) __license__ = "GNU Lesser General Public License (LGPL)" diff --git a/setup.py b/setup.py index 10237f2..f50cfd2 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ if sys.platform == 'darwin': setup(name = "paramiko", - version = "1.12.0", + version = "1.12.1", description = "SSH2 protocol library", author = "Jeff Forcier", author_email = "jeff@bitprophet.org",