Skip to content

Commit

Permalink
Rdme (#358)
Browse files Browse the repository at this point in the history
* Changelog syntax changes
* Updated setup.py dependencies
* Updated docstrings
  • Loading branch information
pkittenis authored Aug 23, 2022
1 parent d812ff3 commit c7fc51a
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 58 deletions.
159 changes: 108 additions & 51 deletions Changelog.rst

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions pssh/clients/base/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def __del__(self):
self.disconnect()

def disconnect(self):
"""Disconnect all clients."""
if not hasattr(self, '_host_clients'):
return
for s_client in self._host_clients.values():
Expand All @@ -126,7 +127,6 @@ def disconnect(self):
except Exception as ex:
logger.debug("Client disconnect failed with %s", ex)
pass
del s_client

def _check_host_config(self):
if self.host_config is None:
Expand Down Expand Up @@ -266,7 +266,7 @@ def get_last_output(self, cmds=None):
:param cmds: Commands to get output for. Defaults to ``client.cmds``
:type cmds: list(:py:class:`gevent.Greenlet`)
:rtype: dict or list
:rtype: list(:py:class:`pssh.output.HostOutput`)
"""
cmds = self.cmds if cmds is None else cmds
if cmds is None:
Expand All @@ -290,7 +290,6 @@ def _get_host_config(self, host_i):
gssapi_server_identity=self.gssapi_server_identity,
gssapi_client_identity=self.gssapi_client_identity,
gssapi_delegate_credentials=self.gssapi_delegate_credentials,
alias=None,
)
return config
config = self.host_config[host_i]
Expand Down
6 changes: 5 additions & 1 deletion pssh/clients/native/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ def _send_keepalive(self):
sleep(self._eagain(self.session.keepalive_send))

def configure_keepalive(self):
"""Configures keepalive on the server for `self.keepalive_seconds`."""
self.session.keepalive_config(False, self.keepalive_seconds)

def _init_session(self, retries=1):
Expand Down Expand Up @@ -266,7 +267,10 @@ def _open_session(self):
return chan

def open_session(self):
"""Open new channel from session"""
"""Open new channel from session.
:rtype: :py:class:`ssh2.channel.Channel`
"""
try:
chan = self._open_session()
except Exception as ex:
Expand Down
2 changes: 1 addition & 1 deletion pssh/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, user=None, port=None, password=None, private_key=None,
:param allow_agent: Enable/disable SSH agent authentication.
:type allow_agent: bool
:param alias: Use an alias for this host.
:type alias: str or int
:type alias: str
:param num_retries: Number of retry attempts before giving up on connection
and SSH operations.
:type num_retries: int
Expand Down
2 changes: 1 addition & 1 deletion pssh/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(self, host, channel, stdin,
:param stdin: Standard input buffer
:type stdin: :py:func:`file`-like object
:param client: `SSHClient` output is coming from.
:type client: :py:class:`pssh.clients.base.single.BaseSSHClient`
:type client: :py:class:`pssh.clients.base.single.BaseSSHClient` or `None`.
:param alias: Host alias.
:type alias: str
:param exception: Exception from host if any
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
'*.tests', '*.tests.*')
),
install_requires=[
'gevent>=1.3.0', 'ssh2-python', 'ssh-python'],
'gevent', 'ssh2-python', 'ssh-python'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)',
Expand Down

0 comments on commit c7fc51a

Please sign in to comment.