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
This commit is contained in:
Toshio Kuratomi 2016-01-18 13:48:37 -08:00
parent 27f4730c29
commit ded02b4968

View file

@ -206,7 +206,10 @@ class ConnectionBase(with_metaclass(ABCMeta, object)):
pass
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):
if self._play_context.prompt is None: