mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Fix enable subprompt (#34723)
* Look for password prompts at the beginning of the line only * Adds secondary checks for the supplied sub-prompts Handles the case for enable prompts where enable_pass may be incorrect and the deivce is still prompting for the password
This commit is contained in:
@@ -395,6 +395,10 @@ class Connection(ConnectionBase):
|
||||
window = self._strip(recv.read())
|
||||
if prompts and not handled:
|
||||
handled = self._handle_prompt(window, prompts, answer, newline)
|
||||
elif prompts and handled:
|
||||
# check again even when handled, a sub-prompt could be
|
||||
# repeating (like in the case of a wrong enable password, etc)
|
||||
self._handle_prompt(window, prompts, answer, newline)
|
||||
|
||||
if self._find_prompt(window):
|
||||
self._last_response = recv.getvalue()
|
||||
|
||||
Reference in New Issue
Block a user