Skip to content

Commit

Permalink
Revert kafka_events code changes
Browse files Browse the repository at this point in the history
Signed-off-by: jamshale <jamiehalebc@gmail.com>
  • Loading branch information
jamshale committed Jul 9, 2024
1 parent d4079e6 commit d7a915e
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions kafka_events/kafka_events/v1_0/kafka_queue/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from aries_cloudagent.config.base import BaseSettings
from aries_cloudagent.config.plugin_settings import PluginSettings
from aries_cloudagent.config.settings import Settings
from pydantic import BaseModel
from pydantic import BaseModel, Extra

LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -44,9 +44,9 @@ class ProducerConfig(BaseModel, SecurityProtocol):
class Config:
"""Configuration for producer."""

extra = "allow"
extra = Extra.allow
alias_generator = _alias_generator
populate_by_name = True
allow_population_by_field_name = True

@classmethod
def default(cls):
Expand All @@ -56,7 +56,7 @@ def default(cls):
@property
def security_protocol(self) -> str:
"""Return the security protocol."""
return self.model_dump().get("security_protocol")
return self.dict().get("security_protocol")


class EventsConfig(BaseModel):
Expand All @@ -69,7 +69,7 @@ class Config:
"""Configuration for events."""

alias_generator = _alias_generator
populate_by_name = True
allow_population_by_field_name = True

@classmethod
def default(cls):
Expand All @@ -93,9 +93,9 @@ class ConsumerConfig(BaseModel, SecurityProtocol):
class Config:
"""Configuration for consumer."""

extra = "allow"
extra = Extra.allow
alias_generator = _alias_generator
populate_by_name = True
allow_population_by_field_name = True

@classmethod
def default(cls):
Expand All @@ -105,7 +105,7 @@ def default(cls):
@property
def security_protocol(self) -> bool:
"""Return the security protocol."""
return self.model_dump().get("security_protocol")
return self.dict().get("security_protocol")


class InboundConfig(BaseModel):
Expand All @@ -118,7 +118,7 @@ class Config:
"""Configuration for inbound."""

alias_generator = _alias_generator
populate_by_name = True
allow_population_by_field_name = True

@classmethod
def default(cls):
Expand Down Expand Up @@ -171,8 +171,6 @@ def get_config(root_settings: BaseSettings) -> KafkaConfig:
LOGGER.warning("Using default configuration")
config = KafkaConfig.default()

LOGGER.debug("Returning config: %s", config.model_dump_json(indent=2))
LOGGER.debug(
"Returning config(aliases): %s", config.model_dump_json(by_alias=True, indent=2)
)
return config
LOGGER.debug("Returning config: %s", config.json(indent=2))
LOGGER.debug("Returning config(aliases): %s", config.json(by_alias=True, indent=2))
return config

0 comments on commit d7a915e

Please sign in to comment.