Browse Source

Rename SSHVendor.connect_ssh to SSHVendor.run_command.

Jelmer Vernooij 11 years ago
parent
commit
a660265499
4 changed files with 12 additions and 7 deletions
  1. 5 0
      NEWS
  2. 5 5
      dulwich/client.py
  3. 1 1
      dulwich/tests/compat/test_client.py
  4. 1 1
      dulwich/tests/test_client.py

+ 5 - 0
NEWS

@@ -27,6 +27,11 @@
 
   * Add paramiko-based SSH vendor. (Aaron O'Mullan)
 
+ API CHANGES
+
+  * SSHVendor.connect_ssh has been renamed to SSHVendor.run_command.
+    (Jelmer Vernooij)
+
 0.9.0	2013-05-31
 
  BUG FIXES

+ 5 - 5
dulwich/client.py

@@ -639,7 +639,7 @@ class SubprocessGitClient(TraditionalGitClient):
 class SSHVendor(object):
     """A client side SSH implementation."""
 
-    def connect_ssh(self, host, command, username=None, port=None):
+    def run_command(self, host, command, username=None, port=None):
         """Connect to an SSH server.
 
         Run a command remotely and return a file-like object for interaction
@@ -650,13 +650,13 @@ class SSHVendor(object):
         :param username: Optional ame of user to log in as
         :param port: Optional SSH port to use
         """
-        raise NotImplementedError(self.connect_ssh)
+        raise NotImplementedError(self.run_command)
 
 
 class SubprocessSSHVendor(SSHVendor):
     """SSH vendor that shells out to the local 'ssh' command."""
 
-    def connect_ssh(self, host, command, username=None, port=None):
+    def run_command(self, host, command, username=None, port=None):
         import subprocess
         #FIXME: This has no way to deal with passwords..
         args = ['ssh', '-x']
@@ -756,7 +756,7 @@ else:
 
     class ParamikoSSHVendor(object):
 
-        def connect_ssh(self, host, command, username=None, port=None,
+        def run_command(self, host, command, username=None, port=None,
                 progress_stderr=None, **kwargs):
             client = paramiko.SSHClient()
 
@@ -793,7 +793,7 @@ class SSHGitClient(TraditionalGitClient):
     def _connect(self, cmd, path):
         if path.startswith("/~"):
             path = path[1:]
-        con = get_ssh_vendor().connect_ssh(
+        con = get_ssh_vendor().run_command(
             self.host, ["%s '%s'" % (self._get_cmd_path(cmd), path)],
             port=self.port, username=self.username)
         return (Protocol(con.read, con.write, report_activity=self._report_activity),

+ 1 - 1
dulwich/tests/compat/test_client.py

@@ -262,7 +262,7 @@ class DulwichTCPClientTest(CompatTestCase, DulwichClientTestBase):
 
 class TestSSHVendor(object):
     @staticmethod
-    def connect_ssh(host, command, username=None, port=None):
+    def run_command(host, command, username=None, port=None):
         cmd, path = command[0].replace("'", '').split(' ')
         cmd = cmd.split('-', 1)
         p = subprocess.Popen(cmd + [path], env=get_safe_env(), stdin=subprocess.PIPE,

+ 1 - 1
dulwich/tests/test_client.py

@@ -386,7 +386,7 @@ class TestSSHVendor(object):
         self.username = None
         self.port = None
 
-    def connect_ssh(self, host, command, username=None, port=None):
+    def run_command(self, host, command, username=None, port=None):
         self.host = host
         self.command = command
         self.username = username