Merge pull request #13268 from tchaikov/wip-better-error-ping-mon

ceph: do not throw TypeError on connection failure

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
Kefu Chai 2017-02-08 11:32:25 +08:00 committed by GitHub
commit 40713870e4

View File

@ -556,7 +556,10 @@ def ping_monitor(cluster_handle, name, timeout):
run_in_thread(cluster_handle.connect, timeout=timeout)
for m in monids() :
s = run_in_thread(cluster_handle.ping_monitor, m)
print("mon.{0}".format(m) + '\n' + s)
if s is None:
print("mon.{0}".format(m) + '\n' + "Error connecting to monitor.")
else:
print("mon.{0}".format(m) + '\n' + s)
else :
s = run_in_thread(cluster_handle.ping_monitor, mon_id)
print(s)