From: Alfredo Deza Date: Thu, 1 May 2014 12:12:16 +0000 (-0400) Subject: bonus points, catch remoto issue #3 X-Git-Tag: v1.5.1~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F183%2Fhead;p=ceph-deploy.git bonus points, catch remoto issue #3 Signed-off-by: Alfredo Deza --- 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))