Fix proposed by @Yannig to fix become success detection when the output is multiline

See the Bug report for a specific error case with local connection,
sudo, and the raw module

Fixes #13728
pull/14019/head
Toshio Kuratomi 9 years ago
parent c06b2e4622
commit c8ffe94bf4

@ -206,7 +206,10 @@ class ConnectionBase(with_metaclass(ABCMeta, object)):
pass pass
def check_become_success(self, output): def check_become_success(self, output):
return self._play_context.success_key == output.rstrip() for line in output.splitlines(True):
if self._play_context.success_key == line.rstrip():
return True
return False
def check_password_prompt(self, output): def check_password_prompt(self, output):
if self._play_context.prompt is None: if self._play_context.prompt is None:

Loading…
Cancel
Save