Changeset 3800:e87acc113978 in livinglogic.python.xist

Show
Ignore:
Timestamp:
06/27/09 17:28:56 (10 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Replace identify argument for ssh URLs with ssh_config.

This mirrors the corresponding change in the py library.

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • NEWS.rst

    r3798 r3800  
    5151*   There's a new function :func:`misc.itersplitat` for splitting a string at 
    5252    specified positions. 
     53 
     54*   For ssh URLs a keyword argument ``ssh_config`` is supported now instead of 
     55    ``identity`` (This mirrors the corresponding change in the py__ library) 
     56 
     57    __ http://codespeak.net/py/dist/ 
    5358 
    5459 
  • src/ll/url.py

    r3768 r3800  
    492492                ``ssh`` URLs) 
    493493 
    494             :var:`identity` : string 
    495                 filename to be used as the identity file (private key) for 
    496                 authentication (used by ``ssh`` URLs) 
     494            :var:`ssh_config` : string 
     495                SSH configuration file (used by ``ssh`` URLs) 
    497496        """ 
    498497 
     
    849848                    channel.send((False, data)) 
    850849        """) 
    851         def __init__(self, context, server, remotepython="python", identity=None): 
     850        def __init__(self, context, server, remotepython="python", ssh_config=None): 
    852851            # We don't have to store the context (this avoids cycles) 
    853852            self.server = server 
    854             gateway = py.execnet.SshGateway(server, remotepython=remotepython, identity=identity) 
     853            gateway = py.execnet.SshGateway(server, remotepython=remotepython, ssh_config=ssh_config) 
    855854            self._channel = gateway.remote_exec(self.remote_code) 
    856855 
     
    15271526class SshSchemeDefinition(SchemeDefinition): 
    15281527    def _connect(self, url, context=None, **kwargs): 
    1529         if "remotepython" in kwargs or "identity" in kwargs: 
     1528        if "remotepython" in kwargs or "ssh_config" in kwargs: 
    15301529            kwargs = kwargs.copy() 
    15311530            remotepython = kwargs.pop("remotepython", "python") 
    1532             identity = kwargs.pop("identity", None) 
     1531            ssh_config = kwargs.pop("ssh_config", None) 
    15331532        else: 
    15341533            remotepython = "python" 
    1535             identity = None 
     1534            ssh_config = None 
    15361535             
    15371536        context = getcontext(context) 
     
    15471546            connection = connections[(server, remotepython)] 
    15481547        except KeyError: 
    1549             connection = connections[(server, remotepython)] = SshConnection(context, server, remotepython, identity) 
     1548            connection = connections[(server, remotepython)] = SshConnection(context, server, remotepython, ssh_config) 
    15501549        return (connection, kwargs) 
    15511550 
    1552     def open(self, url, mode="rb", context=None, remotepython="python", identity=None): 
    1553         (connection, kwargs) = self._connect(url, context, remotepython=remotepython, identity=identity) 
     1551    def open(self, url, mode="rb", context=None, remotepython="python", ssh_config=None): 
     1552        (connection, kwargs) = self._connect(url, context, remotepython=remotepython, ssh_config=ssh_config) 
    15541553        return RemoteFileResource(connection, url, mode, **kwargs) 
    15551554 
     
    28072806                (used by ``ssh`` URLs) 
    28082807 
    2809             :var:`identity` 
    2810                 Filename to be used as the identity file (private key) for 
    2811                 authentication (used by ``ssh`` URLs) 
     2808            :var:`ssh_config` 
     2809                SSH configuration file (used by ``ssh`` URLs) 
    28122810        """ 
    28132811        (connection, kwargs) = self._connect(context=context, **kwargs)