68
68
string_types = six .string_types
69
69
bytes_types = (six .binary_type ,)
70
70
71
- LOST_STATES = (KeeperState .EXPIRED_SESSION , KeeperState .AUTH_FAILED ,
71
+ CLOSED_STATES = (KeeperState .EXPIRED_SESSION , KeeperState .AUTH_FAILED ,
72
72
KeeperState .CLOSED )
73
73
ENVI_VERSION = re .compile (r'([\d\.]*).*' , re .DOTALL )
74
74
ENVI_VERSION_KEY = 'zookeeper.version'
@@ -513,14 +513,14 @@ def _session_callback(self, state):
513
513
514
514
# Note that we don't check self.state == LOST since that's also
515
515
# the client's initial state
516
- dead_state = self ._state in LOST_STATES
516
+ closed_state = self ._state in CLOSED_STATES
517
517
self ._state = state
518
518
519
519
# If we were previously closed or had an expired session, and
520
520
# are now connecting, don't bother with the rest of the
521
521
# transitions since they only apply after
522
522
# we've established a connection
523
- if dead_state and state == KeeperState .CONNECTING :
523
+ if closed_state and state == KeeperState .CONNECTING :
524
524
self .logger .log (BLATHER , "Skipping state change" )
525
525
return
526
526
@@ -529,8 +529,8 @@ def _session_callback(self, state):
529
529
"state: %s" , state )
530
530
self ._live .set ()
531
531
self ._make_state_change (KazooState .CONNECTED )
532
- elif state in LOST_STATES :
533
- self .logger .info ("Zookeeper session lost , state: %s" , state )
532
+ elif state in CLOSED_STATES :
533
+ self .logger .info ("Zookeeper session closed , state: %s" , state )
534
534
self ._live .clear ()
535
535
self ._make_state_change (KazooState .LOST )
536
536
self ._notify_pending (state )
0 commit comments