Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]Add support for libssh connection type #66656

Closed
wants to merge 2 commits into from

Conversation

ganeshrn
Copy link
Member

SUMMARY
  • Add libssh connection type that uses
    pylibssh library (https://github.com/ansible/pylibssh)
    which is Python extension for libssh (https://www.libssh.org/)
  • Refactor network_cli connection plugin to work with both
    libssh and paramiko_ssh connection type under the hood.
    The default connection type is set to libssh and can be
    configured using ssh_transport_type network_cli
    plugin configuration.
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

plugins/connection/libssh.py
plugins/connection/network_cli.py

ADDITIONAL INFORMATION

@ansibot
Copy link
Contributor

ansibot commented Jan 21, 2020

@ansibot ansibot added WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. affects_2.10 This issue/PR affects Ansible v2.10 feature This issue/PR relates to a feature request. needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_triage Needs a first human triage before being processed. networking Network category new_plugin This PR includes a new plugin. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. support:network This issue/PR relates to code supported by the Ansible Network Team. labels Jan 21, 2020
*  Add libssh connection type that uses
   pylibssh library (https://github.com/ansible/pylibssh)
   which is Python extension for libssh (https://www.libssh.org/)
*  Refactor network_cli connection plugin to work with both
   libssh and paramiko_ssh connetion type under the hood.
   The default connection type is set to libssh and can be
   configured using `ssh_transport_type` network_cli
   plugin configuration.
@Akasurde Akasurde self-requested a review January 21, 2020 11:51
@ansibot ansibot removed the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Jan 21, 2020
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jan 29, 2020

def _receive_data(self, buffer):
if self._transport_type == 'libssh':
while True:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean?

Suggested change
while True:
while not self._ssh_shell.poll():
pass

Also, maybe it's worth adding some small sleep?

Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably add ansible-pylibssh to runtime deps.

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Feb 19, 2020
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 12, 2020
@ansibot
Copy link
Contributor

ansibot commented Mar 12, 2020

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/plugins/connection/libssh.py:321:20: undefined-variable: Undefined variable 'q'

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/plugins/connection/libssh.py:231:12: E111: indentation is not a multiple of four

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Mar 12, 2020

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/plugins/connection/libssh.py:231:12: E111: indentation is not a multiple of four

click here for bot help

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 20, 2020
@ansibot ansibot added the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Mar 28, 2020
@ansibot ansibot added collection Related to Ansible Collections work collection:ansible.netcommon has_issue labels Apr 29, 2020
@ganeshrn
Copy link
Member Author

@ganeshrn ganeshrn closed this May 12, 2020
@ansible ansible locked and limited conversation to collaborators Jun 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 collection:ansible.netcommon collection Related to Ansible Collections work feature This issue/PR relates to a feature request. has_issue needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html networking Network category new_plugin This PR includes a new plugin. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. support:network This issue/PR relates to code supported by the Ansible Network Team. WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants