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

Reboot - Fix errors when using Paramiko connection #49002

Merged
merged 2 commits into from
Nov 27, 2018

Conversation

samdoran
Copy link
Contributor

@samdoran samdoran commented Nov 21, 2018

SUMMARY

Different connection plugins return different data when throwing exceptions. The Paramiko connection plugin does not return a text string, which caused an exception.

The ssh connection plugin returns multi-line errors, which makes the debug logs harder to read. Only return the last line in that case in order to make the logs more readable.

Fixes #48948

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

reboot.py

@ansibot
Copy link
Contributor

ansibot commented Nov 21, 2018

Hi @samdoran, thank you for submitting this pull-request!

click here for bot help

@ansibot ansibot added WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. small_patch support:community This issue/PR relates to code supported by the Ansible community. labels Nov 21, 2018
@ansibot ansibot added support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed small_patch labels Nov 21, 2018
@samdoran samdoran changed the title [WIP] Reboot - Fix errors when using Paramiko connection Reboot - Fix errors when using Paramiko connection Nov 21, 2018
samdoran and others added 2 commits November 21, 2018 17:02
Different connection plugins return different data when throwing exceptions. The Paramiko connection plugin does not return a text sting, which caused an exception.

The ssh connection plugin returns multi-line errors, which makes the debug logs harder to read. Only return the last line in that case in order to make the logs more readable.

When experiencing a connection failure, reset the connection.

Co-authored-by: Matt Martz <matt@sivel.net>
Indicate thet conection state is False when running close(). This is neede by the ensure_connected() decorator to work properly.
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. core_review In order to be merged, this PR must follow the core review workflow. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Nov 21, 2018
@manuBocquet
Copy link

Hi,

I did a test this morning. And your fixe solved the problem.

Thanks.

@ansibot ansibot removed the support:community This issue/PR relates to code supported by the Ansible community. label Nov 26, 2018
@abadger abadger removed the needs_triage Needs a first human triage before being processed. label Nov 27, 2018
@samdoran samdoran merged commit 5eb7f57 into ansible:devel Nov 27, 2018
@samdoran samdoran deleted the issue/48948-reboot-paramiko branch November 27, 2018 21:49
samdoran added a commit to samdoran/ansible that referenced this pull request Nov 27, 2018
…ble#49002)

Different connection plugins return different data when throwing exceptions. The Paramiko connection plugin does not return a text sting, which caused an exception.

The ssh connection plugin returns multi-line errors, which makes the debug logs harder to read. Only return the last line in that case in order to make the logs more readable.

When experiencing a connection failure, reset the connection.

Add reset() to paramiko_ssh

Indicate thet conection state is False when running close(). This is needed by the ensure_connected() decorator to work properly.

Co-authored-by: Matt Martz <matt@sivel.net>
(cherry picked from commit 5eb7f57)

Co-authored-by: Sam Doran <sdoran@redhat.com>
mjmayer pushed a commit to mjmayer/ansible that referenced this pull request Nov 30, 2018
Different connection plugins return different data when throwing exceptions. The Paramiko connection plugin does not return a text sting, which caused an exception.

The ssh connection plugin returns multi-line errors, which makes the debug logs harder to read. Only return the last line in that case in order to make the logs more readable.

When experiencing a connection failure, reset the connection.

Add reset() to paramiko_ssh

Indicate thet conection state is False when running close(). This is needed by the ensure_connected() decorator to work properly.


Co-authored-by: Matt Martz <matt@sivel.net>
abadger pushed a commit that referenced this pull request Dec 4, 2018
Different connection plugins return different data when throwing exceptions. The Paramiko connection plugin does not return a text sting, which caused an exception.

The ssh connection plugin returns multi-line errors, which makes the debug logs harder to read. Only return the last line in that case in order to make the logs more readable.

When experiencing a connection failure, reset the connection.

Add reset() to paramiko_ssh

Indicate thet conection state is False when running close(). This is needed by the ensure_connected() decorator to work properly.

Co-authored-by: Matt Martz <matt@sivel.net>
(cherry picked from commit 5eb7f57)

Co-authored-by: Sam Doran <sdoran@redhat.com>
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reboot module does not work with paramiko transport
5 participants