File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 3
3
import hmac
4
4
import json
5
5
import string
6
+ import struct
7
+ import logging
8
+
6
9
7
10
from kafka .vendor .six .moves import urllib
11
+ from kafka .protocol .types import Int32
12
+ import kafka .errors as Errors
13
+
14
+ from botocore .session import Session as BotoSession
15
+
8
16
9
17
10
18
def try_authenticate (self , future ):
@@ -33,7 +41,7 @@ def try_authenticate(self, future):
33
41
data = self ._recv_bytes_blocking (4 )
34
42
data = self ._recv_bytes_blocking (struct .unpack ('4B' , data )[- 1 ])
35
43
except (ConnectionError , TimeoutError ) as e :
36
- log .exception ("%s: Error receiving reply from server" , self )
44
+ logging .exception ("%s: Error receiving reply from server" , self )
37
45
err = Errors .KafkaConnectionError ("%s: %s" % (self , e ))
38
46
close = True
39
47
@@ -42,9 +50,10 @@ def try_authenticate(self, future):
42
50
self .close (error = err )
43
51
return future .failure (err )
44
52
45
- log .info ('%s: Authenticated via AWS_MSK_IAM %s' , self , data .decode ('utf-8' ))
53
+ logging .info ('%s: Authenticated via AWS_MSK_IAM %s' , self , data .decode ('utf-8' ))
46
54
return future .success (True )
47
-
55
+
56
+
48
57
class AwsMskIamClient :
49
58
UNRESERVED_CHARS = string .ascii_letters + string .digits + '-._~'
50
59
You can’t perform that action at this time.
0 commit comments