Skip to content

Commit 875b420

Browse files
committed
avoid KeyError in config validation
1 parent 04a0087 commit 875b420

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kafka/sasl/msk.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
class SaslMechanismAwsMskIam(SaslMechanism):
2525
def __init__(self, **config):
2626
assert BotoSession is not None, 'AWS_MSK_IAM requires the "botocore" package'
27-
assert config['security_protocol'] == 'SASL_SSL', 'AWS_MSK_IAM requires SASL_SSL'
27+
assert config.get('security_protocol', '') == 'SASL_SSL', 'AWS_MSK_IAM requires SASL_SSL'
2828
self._is_done = False
2929
self._is_authenticated = False
3030

0 commit comments

Comments
 (0)