@@ -547,7 +547,6 @@ def check_version(self, timeout=2, strict=False):
547
547
548
548
Returns: version tuple, i.e. (0, 10), (0, 9), (0, 8, 2), ...
549
549
"""
550
-
551
550
# Monkeypatch the connection request timeout
552
551
# Generally this timeout should not get triggered
553
552
# but in case it does, we want it to be reasonably short
@@ -575,11 +574,11 @@ def filter(self, record):
575
574
log .addFilter (log_filter )
576
575
577
576
test_cases = [
578
- ('0.10' , ApiVersionRequest [0 ]()),
579
- ('0.9' , ListGroupsRequest [0 ]()),
580
- ('0.8.2' , GroupCoordinatorRequest [0 ]('kafka-python-default-group' )),
581
- ('0.8.1' , OffsetFetchRequest [0 ]('kafka-python-default-group' , [])),
582
- ('0.8.0' , MetadataRequest [0 ]([])),
577
+ (( 0 , 10 ) , ApiVersionRequest [0 ]()),
578
+ (( 0 , 9 ) , ListGroupsRequest [0 ]()),
579
+ (( 0 , 8 , 2 ) , GroupCoordinatorRequest [0 ]('kafka-python-default-group' )),
580
+ (( 0 , 8 , 1 ) , OffsetFetchRequest [0 ]('kafka-python-default-group' , [])),
581
+ (( 0 , 8 , 0 ) , MetadataRequest [0 ]([])),
583
582
]
584
583
585
584
def connect ():
@@ -615,9 +614,9 @@ def connect():
615
614
self ._sock .setblocking (False )
616
615
617
616
if f .succeeded ():
618
- log .info ('Broker version identifed as %s' , version )
619
- log .info (" Set configuration api_version='%s' to skip auto"
620
- " check_version requests on startup" , version )
617
+ log .info ('Broker version identifed as %s' , '.' . join ( map ( str , version )) )
618
+ log .info (' Set configuration api_version=%s to skip auto'
619
+ ' check_version requests on startup' , version )
621
620
break
622
621
623
622
# Only enable strict checking to verify that we understand failure
@@ -634,7 +633,7 @@ def connect():
634
633
# requests (bug...). In this case we expect to see a correlation
635
634
# id mismatch
636
635
elif (isinstance (f .exception , Errors .CorrelationIdError ) and
637
- version == '0.10' ):
636
+ version == ( 0 , 10 ) ):
638
637
pass
639
638
elif six .PY2 :
640
639
assert isinstance (f .exception .args [0 ], socket .error )
@@ -648,7 +647,7 @@ def connect():
648
647
649
648
log .removeFilter (log_filter )
650
649
self .config ['request_timeout_ms' ] = stashed_request_timeout_ms
651
- return tuple ( map ( int , version . split ( '.' )))
650
+ return version
652
651
653
652
def __repr__ (self ):
654
653
return "<BrokerConnection host=%s/%s port=%d>" % (self .hostname , self .host ,
0 commit comments