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

Fix double prompt issue in network_cli #35439

Merged
merged 1 commit into from Jan 31, 2018

Conversation

ganeshrn
Copy link
Member

@ganeshrn ganeshrn commented Jan 29, 2018

SUMMARY

Fixes #33993

In current implementation, while trying to fetch the
current cli prompt terminal plugin executes \r on the remote host.

If command execution results in a prompt for
example executing enable command results in Password: prompt.
This results in prompt and answer getting out of sync.

To fix it while fetching current prompt from terminal plugin use get_prompt()
api in network_cli that returns the latest matched cli prompt instead of executing \r on the remote host.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

network_cli

ANSIBLE VERSION
2.5
ADDITIONAL INFORMATION

Fixes ansible#33993

In current implementation while trying to fetch the
current cli prompt terminal plugin executes `\r` on remote host.

This causes if command execution results in a prompt for
example executing `enable` command results in `Password:` prompt
there by executing `\r` on password prompt which is not intended.

To fix it while fetching current prompt from terminal plugin use `get_prompt()`
api in network_cli that returns the latest matched prompt instead of
unnecessary executing `\r` on remote host.
@ansibot ansibot added bugfix_pull_request needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jan 29, 2018
@trishnaguha trishnaguha added networking Network category and removed needs_triage Needs a first human triage before being processed. labels Jan 29, 2018
@ganeshrn ganeshrn merged commit 3119188 into ansible:devel Jan 31, 2018
@ganeshrn ganeshrn deleted the terminal_prompt_issue branch January 31, 2018 06:13
Lujeni pushed a commit to Lujeni/ansible that referenced this pull request Feb 1, 2018
Fixes ansible#33993

In current implementation while trying to fetch the
current cli prompt terminal plugin executes `\r` on remote host.

This causes if command execution results in a prompt for
example executing `enable` command results in `Password:` prompt
there by executing `\r` on password prompt which is not intended.

To fix it while fetching current prompt from terminal plugin use `get_prompt()`
api in network_cli that returns the latest matched prompt instead of
unnecessary executing `\r` on remote host.
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bugfix_pull_request labels Mar 6, 2018
@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug. networking Network category 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.

AnsibleConnectionFailure("timeout trying to send command: %s" % command.strip())
4 participants