Changeset 4d3f610fccda…
Parent fcd6aa89ee95…
by
Changes to 4 files · Browse files at 4d3f610fccda Showing diff from parent fcd6aa89ee95 Diff from another changeset...
@@ -26,6 +26,11 @@ (David Bennett)
* 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
|
@@ -639,7 +639,7 @@ 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 @@ :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 @@
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 @@ 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),
|
@@ -262,7 +262,7 @@
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,
|
@@ -386,7 +386,7 @@ 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
|
Loading...