1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix regex on ASA password prompt (#49438)

On Cisco ASAv on AWS, the prompt is 'Password', thus the privilege
elevation fails, we need to check upper and lower p.
This commit is contained in:
Ricardo Carrillo Cruz 2018-12-03 14:00:28 +01:00 committed by John R Barker
parent a6db7f7abd
commit 5ffb863f0b

View file

@ -58,7 +58,7 @@ class TerminalModule(TerminalBase):
if passwd: if passwd:
# Note: python-3.5 cannot combine u"" and r"" together. Thus make # 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. # 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]?[Pp]assword: $", errors='surrogate_or_strict')
cmd[u'answer'] = passwd cmd[u'answer'] = passwd
try: try: