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 <zack@redhat.com>
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: