mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -07: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:
parent
56eeaf1b2f
commit
3b98a2981c
2 changed files with 5 additions and 1 deletions
|
@ -63,7 +63,7 @@ class TerminalModule(TerminalBase):
|
|||
if passwd:
|
||||
# Note: python-3.5 cannot combine u"" and r"" together. Thus make
|
||||
# an r string and use to_text to ensure it's text on both py2 and py3.
|
||||
cmd[u'prompt'] = to_text(r"[\r\n]?password: $", errors='surrogate_or_strict')
|
||||
cmd[u'prompt'] = to_text(r"[\r\n]password: $", errors='surrogate_or_strict')
|
||||
cmd[u'answer'] = passwd
|
||||
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue