From: Dan Mick Date: Thu, 27 Apr 2017 23:07:22 +0000 (-0700) Subject: pybind/ceph_daemon.py: _gettermsize fails on non-terminals X-Git-Tag: v12.0.3~71^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5e8bdb2b39e95d27c3138caaa30b935b3b380036;p=ceph.git pybind/ceph_daemon.py: _gettermsize fails on non-terminals default to 80x25; this should be for terminalless tests only Signed-off-by: Dan Mick --- diff --git a/src/pybind/ceph_daemon.py b/src/pybind/ceph_daemon.py index 234a1866e6f5..48bd4e0d7cef 100755 --- a/src/pybind/ceph_daemon.py +++ b/src/pybind/ceph_daemon.py @@ -88,7 +88,12 @@ def admin_socket(asok_path, cmd, format=''): def _gettermsize(): - return struct.unpack('hhhh', ioctl(0, TIOCGWINSZ, 8*'\x00'))[0:2] + try: + rows, cols = struct.unpack('hhhh', ioctl(0, TIOCGWINSZ, 8*'\x00'))[0:2] + except IOError: + return 25, 80 + + return rows,cols class Termsize(object):