Commit b2a433dc authored by David Wilson's avatar David Wilson

ssh: CompressionLevel is a v1-only option.

It's ignored by newer SSHes, which only pay attention to Compression.
parent b433645d
...@@ -596,7 +596,7 @@ Router Class ...@@ -596,7 +596,7 @@ Router Class
:py:class:`mitogen.core.StreamError` to be raised, and that :py:class:`mitogen.core.StreamError` to be raised, and that
attributes of the stream match the actual behaviour of ``sudo``. attributes of the stream match the actual behaviour of ``sudo``.
.. method:: ssh (hostname, username=None, ssh_path=None, port=None, check_host_keys=True, password=None, identity_file=None, compression_level=6, \**kwargs) .. method:: ssh (hostname, username=None, ssh_path=None, port=None, check_host_keys=True, password=None, identity_file=None, compression=True, \**kwargs)
Arrange for a context to be constructed over a ``ssh`` invocation. The Arrange for a context to be constructed over a ``ssh`` invocation. The
``ssh`` process is started in a newly allocated pseudo-terminal, and ``ssh`` process is started in a newly allocated pseudo-terminal, and
...@@ -628,10 +628,12 @@ Router Class ...@@ -628,10 +628,12 @@ Router Class
the SSH client to perform authenticaion; agent authentication is the SSH client to perform authenticaion; agent authentication is
automatically disabled, as is reading the default private key from automatically disabled, as is reading the default private key from
``~/.ssh/id_rsa``, or ``~/.ssh/id_dsa``. ``~/.ssh/id_rsa``, or ``~/.ssh/id_dsa``.
:param int compression_level: :param bool compression:
Integer 0-9 representing the zlib compression level to use on the If :py:data:`True`, enable ``ssh`` compression support. Compression
connection, with 0 indicating compression is disabled. Defaults to has a minimal effect on the size of modules transmitted, as they
6. are already compressed, however it has a large effect on every
remaining message in the otherwise uncompressed stream protocol,
such as function call arguments and return values.
Context Class Context Class
......
...@@ -61,7 +61,7 @@ class Stream(mitogen.parent.Stream): ...@@ -61,7 +61,7 @@ class Stream(mitogen.parent.Stream):
def construct(self, hostname, username=None, ssh_path=None, port=None, def construct(self, hostname, username=None, ssh_path=None, port=None,
check_host_keys=True, password=None, identity_file=None, check_host_keys=True, password=None, identity_file=None,
compression_level=6, ssh_args=None, **kwargs): compression=True, ssh_args=None, **kwargs):
super(Stream, self).construct(**kwargs) super(Stream, self).construct(**kwargs)
self.hostname = hostname self.hostname = hostname
self.username = username self.username = username
...@@ -69,7 +69,7 @@ class Stream(mitogen.parent.Stream): ...@@ -69,7 +69,7 @@ class Stream(mitogen.parent.Stream):
self.check_host_keys = check_host_keys self.check_host_keys = check_host_keys
self.password = password self.password = password
self.identity_file = identity_file self.identity_file = identity_file
self.compression_level = compression_level self.compression = compression
if ssh_path: if ssh_path:
self.ssh_path = ssh_path self.ssh_path = ssh_path
if ssh_args: if ssh_args:
...@@ -87,11 +87,8 @@ class Stream(mitogen.parent.Stream): ...@@ -87,11 +87,8 @@ class Stream(mitogen.parent.Stream):
bits += ['-o', 'IdentitiesOnly yes'] bits += ['-o', 'IdentitiesOnly yes']
if self.identity_file: if self.identity_file:
bits += ['-i', self.identity_file] bits += ['-i', self.identity_file]
if self.compression_level: if self.compression:
bits += [ bits += ['-o', 'Compression yes']
'-o', 'Compression yes',
'-o', 'CompressionLevel %d' % (self.compression_level,)
]
if not self.check_host_keys: if not self.check_host_keys:
bits += [ bits += [
'-o', 'StrictHostKeyChecking no', '-o', 'StrictHostKeyChecking no',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment