Skip to content

Commit 2cfb492

Browse files
committed
fix imports
1 parent fcdb09f commit 2cfb492

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

kafka/sasl/msk.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
import hmac
44
import json
55
import string
6+
import struct
7+
import logging
8+
69

710
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+
816

917

1018
def try_authenticate(self, future):
@@ -33,7 +41,7 @@ def try_authenticate(self, future):
3341
data = self._recv_bytes_blocking(4)
3442
data = self._recv_bytes_blocking(struct.unpack('4B', data)[-1])
3543
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)
3745
err = Errors.KafkaConnectionError("%s: %s" % (self, e))
3846
close = True
3947

@@ -42,9 +50,10 @@ def try_authenticate(self, future):
4250
self.close(error=err)
4351
return future.failure(err)
4452

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'))
4654
return future.success(True)
47-
55+
56+
4857
class AwsMskIamClient:
4958
UNRESERVED_CHARS = string.ascii_letters + string.digits + '-._~'
5059

0 commit comments

Comments
 (0)