Fix authorize: yes and become_method: enable (#32864)

* Update connection play_context when socket exists

* Don't fail on connections other than network_cli

* Fix enable prompt detection on ios & eos

* Check against "Module not found" error code, defined in modules/jsonrpc.py
This commit is contained in:
Nathaniel Case 2017-11-14 15:51:14 -05:00 committed by GitHub
parent 3fedd88a9f
commit a1517234f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 8 deletions

View file

@ -60,7 +60,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'prompts'] = to_text(r"[\r\n]?password: $", errors='surrogate_or_strict')
cmd[u'answer'] = passwd
try: