From df5fc7af67aed3aa2d2aeea4cef03d8dd790f1a4 Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Tue, 6 Feb 2018 12:10:32 +0530 Subject: [PATCH] Fix ios enable password regex in terminal plugin (#35741) Fixes #33993 On some ios devices the enable password prompt does not end with a space, add a fix to handle this scenario. --- lib/ansible/plugins/terminal/ios.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/terminal/ios.py b/lib/ansible/plugins/terminal/ios.py index c472a740a1..af9e3bf29a 100644 --- a/lib/ansible/plugins/terminal/ios.py +++ b/lib/ansible/plugins/terminal/ios.py @@ -64,7 +64,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 cmd[u'prompt_retry_check'] = True try: