mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-05 16:04:09 -07:00
Fixes prompt doubling issue that impacted missing ios enable password prompts. (#33794)
* Fixes a prompt doubling issue that impacted missing ios enable password prompts. Due to get_prompt sending a '\n' the prompts became doubled and out-of-sync with what was expected. This caused the enable command prompts to be missed. Also added verification that on_become succeeded to reach enable prompt. * Moved prompt doubling comment per shippable
This commit is contained in:
parent
3c0a84349b
commit
d59bba4652
2 changed files with 9 additions and 2 deletions
|
@ -65,8 +65,12 @@ class TerminalModule(TerminalBase):
|
|||
|
||||
try:
|
||||
self._exec_cli_command(to_bytes(json.dumps(cmd), errors='surrogate_or_strict'))
|
||||
prompt = self._get_prompt()
|
||||
if not prompt.endswith(b'#'):
|
||||
raise AnsibleConnectionFailure('failed to elevate privilege to enable mode still at prompt [%s]' % prompt)
|
||||
except AnsibleConnectionFailure:
|
||||
raise AnsibleConnectionFailure('unable to elevate privilege to enable mode')
|
||||
prompt = self._get_prompt()
|
||||
raise AnsibleConnectionFailure('unable to elevate privilege to enable mode, at prompt [%s]' % prompt)
|
||||
|
||||
def on_unbecome(self):
|
||||
prompt = self._get_prompt()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue