Skip to content

Commit 4dda24d

Browse files
run bump-pydantic
1 parent 90f045b commit 4dda24d

File tree

1 file changed

+15
-8
lines changed
  • services/efs-guardian/src/simcore_service_efs_guardian/core

1 file changed

+15
-8
lines changed

services/efs-guardian/src/simcore_service_efs_guardian/core/settings.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
LogLevel,
99
VersionTag,
1010
)
11-
from pydantic import Field, PositiveInt, validator
11+
from pydantic import AliasChoices, Field, PositiveInt, field_validator
1212
from settings_library.base import BaseCustomSettings
1313
from settings_library.efs import AwsEfsSettings
1414
from settings_library.rabbit import RabbitSettings
@@ -59,28 +59,35 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
5959

6060
# RUNTIME -----------------------------------------------------------
6161
EFS_GUARDIAN_DEBUG: bool = Field(
62-
default=False, description="Debug mode", env=["EFS_GUARDIAN_DEBUG", "DEBUG"]
62+
default=False,
63+
description="Debug mode",
64+
validation_alias=AliasChoices("EFS_GUARDIAN_DEBUG", "DEBUG"),
6365
)
6466
EFS_GUARDIAN_LOGLEVEL: LogLevel = Field(
65-
LogLevel.INFO, env=["EFS_GUARDIAN_LOGLEVEL", "LOG_LEVEL", "LOGLEVEL"]
67+
LogLevel.INFO,
68+
validation_alias=AliasChoices("EFS_GUARDIAN_LOGLEVEL", "LOG_LEVEL", "LOGLEVEL"),
6669
)
6770
EFS_GUARDIAN_LOG_FORMAT_LOCAL_DEV_ENABLED: bool = Field(
6871
default=False,
69-
env=[
72+
validation_alias=AliasChoices(
7073
"EFS_GUARDIAN_LOG_FORMAT_LOCAL_DEV_ENABLED",
7174
"LOG_FORMAT_LOCAL_DEV_ENABLED",
72-
],
75+
),
7376
description="Enables local development log format. WARNING: make sure it is disabled if you want to have structured logs!",
7477
)
7578

76-
EFS_GUARDIAN_AWS_EFS_SETTINGS: AwsEfsSettings = Field(auto_default_from_env=True)
77-
EFS_GUARDIAN_RABBITMQ: RabbitSettings = Field(auto_default_from_env=True)
79+
EFS_GUARDIAN_AWS_EFS_SETTINGS: AwsEfsSettings = Field(
80+
json_schema_extra={"auto_default_from_env": True}
81+
)
82+
EFS_GUARDIAN_RABBITMQ: RabbitSettings = Field(
83+
json_schema_extra={"auto_default_from_env": True}
84+
)
7885

7986
@cached_property
8087
def LOG_LEVEL(self) -> LogLevel: # noqa: N802
8188
return self.EFS_GUARDIAN_LOGLEVEL
8289

83-
@validator("EFS_GUARDIAN_LOGLEVEL")
90+
@field_validator("EFS_GUARDIAN_LOGLEVEL")
8491
@classmethod
8592
def valid_log_level(cls, value: str) -> str:
8693
return cls.validate_log_level(value)

0 commit comments

Comments
 (0)