1
0
Fork 0

Put some exception handling back in

master
Philip O'Toole 2 years ago
parent 65d0b06676
commit 8bd5d32982

@ -319,13 +319,22 @@ class Node(object):
'''
is_leader returns whether this node is the cluster leader
'''
return self.status()['store']['raft']['state'] == 'Leader'
try:
return self.status()['store']['raft']['state'] == 'Leader'
except requests.exceptions.ConnectionError:
return False
def is_follower(self):
return self.status()['store']['raft']['state'] == 'Follower'
try:
return self.status()['store']['raft']['state'] == 'Follower'
except requests.exceptions.ConnectionError:
return False
def is_voter(self):
return self.status()['store']['raft']['voter'] == True
try:
return self.status()['store']['raft']['voter'] == True
except requests.exceptions.ConnectionError:
return False
def disco_mode(self):
try:

Loading…
Cancel
Save