Skip to content

Commit

Permalink
fix: more style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
whuang1202 committed Aug 9, 2022
1 parent 38bfaa6 commit c027df5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions edx_event_bus_kafka/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ def create_schema_registry_client() -> Optional[SchemaRegistryClient]:
warnings.warn("Cannot configure event-bus-kafka: Missing setting EVENT_BUS_KAFKA_SCHEMA_REGISTRY_URL")
return None

key = getattr(settings, 'EVENT_BUS_KAFKA_SCHEMA_REGISTRY_API_KEY', '')
key = getattr(settings, 'EVENT_BUS_KAFKA_SCHEMA_REGISTRY_API_KEY', '')
secret = getattr(settings, 'EVENT_BUS_KAFKA_SCHEMA_REGISTRY_API_SECRET', '')

return SchemaRegistryClient({
'url': url,
'basic.auth.user.info': f"{key}:{secret}",
})


def load_common_settings() -> Optional[dict]:
"""
Load common settings, a base for either producer or consumer configuration.
Expand All @@ -39,7 +40,7 @@ def load_common_settings() -> Optional[dict]:
'bootstrap.servers': bootstrap_servers,
}

key = getattr(base_settings, 'EVENT_BUS_KAFKA_API_KEY', None)
key = getattr(base_settings, 'EVENT_BUS_KAFKA_API_KEY', None)
secret = getattr(base_settings, 'EVENT_BUS_KAFKA_API_SECRET', None)

if key and secret:
Expand Down

0 comments on commit c027df5

Please sign in to comment.