Skip to content

Commit

Permalink
DDD re #717
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet committed Sep 30, 2019
1 parent d36f0b4 commit fab7b20
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
8 changes: 5 additions & 3 deletions paramiko/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ def lookup(self, hostname):
The host-matching rules of OpenSSH's ``ssh_config`` man page are used:
For each parameter, the first obtained value will be used. The
configuration files contain sections separated by ``Host``
specifications, and that section is only applied for hosts that match
one of the patterns given in the specification.
configuration files contain sections separated by ``Host`` and/or
``Match`` specifications, and that section is only applied for hosts
which match the given patterns or keywords
Since the first obtained value for each parameter is used, more host-
specific declarations should be given near the beginning of the file,
Expand All @@ -174,6 +174,8 @@ def lookup(self, hostname):
Returns `SSHConfigDict` objects instead of dict literals.
.. versionchanged:: 2.7
Added canonicalization support.
.. versionchanged:: 2.7
Added ``Match`` support.
"""
# First pass
options = self._lookup(hostname=hostname)
Expand Down
4 changes: 4 additions & 0 deletions sites/docs/api/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ Paramiko releases) are included. A keyword by itself means no known departures.

- ``Host``
- ``HostName``: used in ``%h`` :ref:`token expansion <TOKENS>`
- ``Match``

.. versionadded:: 2.7

- ``Port``: supplies potential values for ``%p`` :ref:`token expansion
<TOKENS>`.
- ``ProxyCommand``: see our `.ProxyCommand` class for an easy
Expand Down
4 changes: 4 additions & 0 deletions sites/www/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Changelog
=========

- :feature:`717` Implement support for the ``Match`` keyword in ``ssh_config``
files. Previously, this keyword was simply ignored & keywords inside such
blocks were treated as if they were part of the previous block. Thanks to
Michael Leinartas for the initial patchset.
- :bug:`- major` Perform deduplication of ``IdentityFile`` contents during
``ssh_config`` parsing; previously, if your config would result in the same
value being encountered more than once, ``IdentityFile`` would contain that
Expand Down

0 comments on commit fab7b20

Please sign in to comment.