Merge "zk: check for client in properties"

This commit is contained in:
Zuul 2018-01-30 21:58:22 +00:00 committed by Gerrit Code Review
commit 29ae581004
1 changed files with 6 additions and 0 deletions

View File

@ -715,14 +715,20 @@ class ZooKeeper(object):
@property
def connected(self):
if self.client is None:
return False
return self.client.state == KazooState.CONNECTED
@property
def suspended(self):
if self.client is None:
return True
return self.client.state == KazooState.SUSPENDED
@property
def lost(self):
if self.client is None:
return True
return self.client.state == KazooState.LOST
@property