From 3c12d9a32ed82e15ae8c25b00f8fc612ce64b303 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 1 Sep 2016 09:11:28 -0600 Subject: [PATCH] copy_to_log(): Drop use of readlines() http://tracker.ceph.com/issues/17102 Fixes: 17102 Calling readlines() on the source object causes the teuthology thread to block on the remote command's execution. Instead, iterate over the source object as advised at: https://docs.python.org/2.7/library/stdtypes.html#file.xreadlines This interface is also supported by StringIO and cStringIO. Signed-off-by: Zack Cerza --- teuthology/orchestra/run.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/teuthology/orchestra/run.py b/teuthology/orchestra/run.py index 4754cb5ee5..43c9eb8ece 100644 --- a/teuthology/orchestra/run.py +++ b/teuthology/orchestra/run.py @@ -237,14 +237,11 @@ def quote(args): def copy_to_log(f, logger, loglevel=logging.INFO): - """ - Interface to older xreadlines api. - """ # Work-around for http://tracker.ceph.com/issues/8313 if isinstance(f, ChannelFile): f._flags += ChannelFile.FLAG_BINARY - for line in f.readlines(): + for line in f: line = line.rstrip() # Second part of work-around for http://tracker.ceph.com/issues/8313 try: -- 2.39.5