mirror of
https://github.com/ceph/ceph
synced 2024-12-19 01:46:00 +00:00
ceph: do not throw TypeError on connection failure
otherwise we could concat None with a string on connection problem. which will result in TypeError. and the caller will print misleading error like Error connecting to cluster: TypeError see also #12934 Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
21cdcfcc66
commit
d832c0ed56
@ -541,7 +541,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)
|
||||
|
Loading…
Reference in New Issue
Block a user