From e0e98d10ceacb9853cb5e6cb7c8f78cf8db3263b Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 23 Feb 2012 22:09:23 -0500 Subject: [PATCH] use readlines on stdout so we'll block on long running commands --- lib/ansible/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/__init__.py b/lib/ansible/__init__.py index 77012dda9a1..37d6d38e51e 100755 --- a/lib/ansible/__init__.py +++ b/lib/ansible/__init__.py @@ -25,6 +25,7 @@ from itertools import izip import os import json import traceback +import select # non-core import paramiko @@ -143,7 +144,7 @@ class Runner(object): def _exec_command(self, conn, cmd): ''' execute a command over SSH ''' stdin, stdout, stderr = conn.exec_command(cmd) - results = stdout.read() + results = "\n".join(stdout.readlines()) return results def _copy_module(self, conn):