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

Missing Exception Handling in SSH Plugin Fixed Error Verbosity Issue #82354

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from

Conversation

Hacodex
Copy link

@Hacodex Hacodex commented Dec 5, 2023

Fix for issue #58133

SUMMARY
  • Added error verbosity for sshpass errors 1-6 excluding 5
  • raised an exception if no_log
  • converted erroneous command to text
ISSUE TYPE
  • Bugfix Pull Request
ADDITIONAL INFORMATION

@ansibot ansibot added bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Dec 5, 2023
@ansibot
Copy link
Contributor

ansibot commented Dec 5, 2023

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

lib/ansible/plugins/connection/ssh.py:481:0: trailing-whitespace: Trailing whitespace

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

lib/ansible/plugins/connection/ssh.py:481:1: W293: blank line contains whitespace

click here for bot help

@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Dec 5, 2023
@ansibot ansibot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Dec 5, 2023
@Hacodex Hacodex changed the title Missing Exception Handling in SSH Plugin Fixed Error Verbosity Issue#… Missing Exception Handling in SSH Plugin Fixed Error Verbosity Issue Dec 5, 2023
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Dec 7, 2023
Copy link
Contributor

@jborean93 jborean93 left a comment

Choose a reason for hiding this comment

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

error_code = return_tuple[0]
cmd_error = to_native(return_tuple[2]).rstrip()
error_messages = {
1: "sshpass: Invalid command line argument. Command given ({})".format(cmd_error),
Copy link
Contributor

Choose a reason for hiding this comment

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

I would avoid embedding the stderr for this and the next one in case it contains sensitive information that should not be exposed in no_log.

@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Dec 7, 2023
@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 Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants