File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 11
11
from kafka .protocol .types import Int32
12
12
import kafka .errors as Errors
13
13
14
- import boto3
15
- from botocore .session import Session as BotoSession
16
-
17
-
18
14
19
15
def try_authenticate (self , future ):
16
+ from botocore .session import Session as BotoSession # importing it in advance is not an option apparently...
17
+
20
18
session = BotoSession ()
21
19
credentials = session .get_credentials ().get_frozen_credentials ()
22
20
client = AwsMskIamClient (
Original file line number Diff line number Diff line change 1
1
import datetime
2
2
import json
3
3
4
- from kafka .msk import AwsMskIamClient
4
+ from kafka .sasl . msk import AwsMskIamClient
5
5
6
6
try :
7
7
from unittest import mock
11
11
12
12
def client_factory (token = None ):
13
13
now = datetime .datetime .utcfromtimestamp (1629321911 )
14
- with mock .patch ('kafka.msk.datetime' ) as mock_dt :
14
+ with mock .patch ('kafka.sasl. msk.datetime' ) as mock_dt :
15
15
mock_dt .datetime .utcnow = mock .Mock (return_value = now )
16
16
return AwsMskIamClient (
17
17
host = 'localhost' ,
You can’t perform that action at this time.
0 commit comments