summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2016-04-24 20:20:17 -0700
committerJeff Forcier <jeff@bitprophet.org>2016-04-24 20:20:17 -0700
commitbf2625109700470e9a1b4022220219da10179527 (patch)
tree9fd5afbe77846129d8489f9ffb0572b1b215bcdc
parentca21c9f648590e38e52fa8799f1d6f074d0055de (diff)
parent1cda0eb75cd5e1f7da383e52df349ae8419349e8 (diff)
downloadparamiko-bf2625109700470e9a1b4022220219da10179527.tar.gz
Merge branch 'master' into 394-int
-rw-r--r--.travis.yml3
-rw-r--r--paramiko/client.py21
-rw-r--r--paramiko/primes.py4
-rw-r--r--setup.py23
-rw-r--r--sites/www/changelog.rst6
5 files changed, 34 insertions, 23 deletions
diff --git a/.travis.yml b/.travis.yml
index 55cba46d..3b7b2b42 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,8 @@
language: python
sudo: false
+cache:
+ directories:
+ - $HOME/.cache/pip
python:
- "2.6"
- "2.7"
diff --git a/paramiko/client.py b/paramiko/client.py
index 8d899a15..e3d3780e 100644
--- a/paramiko/client.py
+++ b/paramiko/client.py
@@ -164,10 +164,23 @@ class SSHClient (ClosingContextManager):
def set_missing_host_key_policy(self, policy):
"""
- Set the policy to use when connecting to a server that doesn't have a
- host key in either the system or local `.HostKeys` objects. The
- default policy is to reject all unknown servers (using `.RejectPolicy`).
- You may substitute `.AutoAddPolicy` or write your own policy class.
+ Set policy to use when connecting to servers without a known host key.
+
+ Specifically:
+
+ * A **policy** is an instance of a "policy class", namely some subclass
+ of `.MissingHostKeyPolicy` such as `.RejectPolicy` (the default),
+ `.AutoAddPolicy`, `.WarningPolicy`, or a user-created subclass.
+
+ .. note::
+ This method takes class **instances**, not **classes** themselves.
+ Thus it must be called as e.g.
+ ``.set_missing_host_key_policy(WarningPolicy())`` and *not*
+ ``.set_missing_host_key_policy(WarningPolicy)``.
+
+ * A host key is **known** when it appears in the client object's cached
+ host keys structures (those manipulated by `load_system_host_keys`
+ and/or `load_host_keys`).
:param .MissingHostKeyPolicy policy:
the policy to use when receiving a host key from a
diff --git a/paramiko/primes.py b/paramiko/primes.py
index 7415c182..d0e17575 100644
--- a/paramiko/primes.py
+++ b/paramiko/primes.py
@@ -113,12 +113,12 @@ class ModulusPack (object):
good = -1
# find nearest bitsize >= preferred
for b in bitsizes:
- if (b >= prefer) and (b < max) and (b < good or good == -1):
+ if (b >= prefer) and (b <= max) and (b < good or good == -1):
good = b
# if that failed, find greatest bitsize >= min
if good == -1:
for b in bitsizes:
- if (b >= min) and (b < max) and (b > good):
+ if (b >= min) and (b <= max) and (b > good):
good = b
if good == -1:
# their entire (min, max) range has no intersection with our range.
diff --git a/setup.py b/setup.py
index 4f3cab9d..4f370d63 100644
--- a/setup.py
+++ b/setup.py
@@ -31,23 +31,9 @@ To install the `in-development version
`pip install paramiko==dev`.
'''
-# if someday we want to *require* setuptools, uncomment this:
-# (it will cause setuptools to be automatically downloaded)
-#import ez_setup
-#ez_setup.use_setuptools()
-
import sys
-try:
- from setuptools import setup
- kw = {
- 'install_requires': [
- 'cryptography>=0.8',
- 'pyasn1>=0.1.7',
- ],
- }
-except ImportError:
- from distutils.core import setup
- kw = {}
+from setuptools import setup
+
if sys.platform == 'darwin':
import setup_helper
@@ -89,5 +75,8 @@ setup(
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
- **kw
+ install_requires=[
+ 'cryptography>=0.8',
+ 'pyasn1>=0.1.7',
+ ],
)
diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst
index 7f3667e3..488360d7 100644
--- a/sites/www/changelog.rst
+++ b/sites/www/changelog.rst
@@ -2,6 +2,12 @@
Changelog
=========
+* :support:`729 backported` Clean up ``setup.py`` to always use ``setuptools``,
+ not doing so was a historical artifact from bygone days. Thanks to Alex
+ Gaynor.
+* :bug:`649 major` Update the module in charge of handling SSH moduli so it's
+ consistent with OpenSSH behavior re: prime number selection. Thanks to Damien
+ Tournoud for catch & patch.
* :bug:`617` (aka `fabric/fabric#1429
<https://github.com/fabric/fabric/issues/1429>`_; via :issue:`679`; related:
:issue:`678`, :issue:`685`, :issue:`615` & :issue:`616`) Fix up