From 46e873931e9614a9349044f51682f9b208f456f2 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Thu, 1 May 2014 08:12:16 -0400 Subject: [PATCH] bonus points, catch remoto issue #3 Signed-off-by: Alfredo Deza --- ceph_deploy/osd.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ceph_deploy/osd.py b/ceph_deploy/osd.py index 2aea14e..7fc405d 100644 --- a/ceph_deploy/osd.py +++ b/ceph_deploy/osd.py @@ -124,10 +124,17 @@ def osd_status_check(conn, cluster): '--format=json', ] - out, err, code = process.check( - conn, - command, - ) + try: + out, err, code = process.check( + conn, + command, + ) + except TypeError: + # XXX This is a bug in remoto. If the other end disconnects with a timeout + # it will return a None, and here we are expecting a 3 item tuple, not a None + # so it will break with a TypeError. Once remoto fixes this, we no longer need + # this try/except. + return {} try: loaded_json = json.loads(''.join(out)) -- 2.47.3