Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
b2a433dc
Commit
b2a433dc
authored
Mar 11, 2018
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ssh: CompressionLevel is a v1-only option.
It's ignored by newer SSHes, which only pay attention to Compression.
parent
b433645d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
docs/api.rst
docs/api.rst
+7
-5
mitogen/ssh.py
mitogen/ssh.py
+4
-7
No files found.
docs/api.rst
View file @
b2a433dc
...
...
@@ -596,7 +596,7 @@ Router Class
:py:class:`mitogen.core.StreamError` to be raised, and that
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
``ssh`` process is started in a newly allocated pseudo-terminal, and
...
...
@@ -628,10 +628,12 @@ Router Class
the SSH client to perform authenticaion; agent authentication is
automatically disabled, as is reading the default private key from
``~/.ssh/id_rsa``, or ``~/.ssh/id_dsa``.
:param int compression_level:
Integer 0-9 representing the zlib compression level to use on the
connection, with 0 indicating compression is disabled. Defaults to
6.
:param bool compression:
If :py:data:`True`, enable ``ssh`` compression support. Compression
has a minimal effect on the size of modules transmitted, as they
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
...
...
mitogen/ssh.py
View file @
b2a433dc
...
...
@@ -61,7 +61,7 @@ class Stream(mitogen.parent.Stream):
def
construct
(
self
,
hostname
,
username
=
None
,
ssh_path
=
None
,
port
=
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
)
self
.
hostname
=
hostname
self
.
username
=
username
...
...
@@ -69,7 +69,7 @@ class Stream(mitogen.parent.Stream):
self
.
check_host_keys
=
check_host_keys
self
.
password
=
password
self
.
identity_file
=
identity_file
self
.
compression
_level
=
compression_level
self
.
compression
=
compression
if
ssh_path
:
self
.
ssh_path
=
ssh_path
if
ssh_args
:
...
...
@@ -87,11 +87,8 @@ class Stream(mitogen.parent.Stream):
bits
+=
[
'-o'
,
'IdentitiesOnly yes'
]
if
self
.
identity_file
:
bits
+=
[
'-i'
,
self
.
identity_file
]
if
self
.
compression_level
:
bits
+=
[
'-o'
,
'Compression yes'
,
'-o'
,
'CompressionLevel %d'
%
(
self
.
compression_level
,)
]
if
self
.
compression
:
bits
+=
[
'-o'
,
'Compression yes'
]
if
not
self
.
check_host_keys
:
bits
+=
[
'-o'
,
'StrictHostKeyChecking no'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment