Skip to content

Commit 3d4bb90

Browse files
committed
multifix
1 parent 1d38fb0 commit 3d4bb90

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

packages/settings-library/tests/test_utils_logging.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ class Settings(BaseCustomSettings, MixinLoggingSettings):
2525
],
2626
)
2727

28-
APPNAME_DEBUG: bool = Field(False, description="Starts app in debug mode")
28+
APPNAME_DEBUG: bool = Field(
29+
default=False, description="Starts app in debug mode"
30+
)
2931

30-
@validator("LOG_LEVEL")
32+
@validator("LOG_LEVEL", pre=True)
3133
@classmethod
32-
def _v(cls, value) -> str:
34+
def _v(cls, value: str) -> str:
3335
return cls.validate_log_level(value)
3436

3537
# -----------------------------------------------------------

services/autoscaling/src/simcore_service_autoscaling/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
298298
def LOG_LEVEL(self): # noqa: N802
299299
return self.AUTOSCALING_LOGLEVEL
300300

301-
@validator("AUTOSCALING_LOGLEVEL")
301+
@validator("AUTOSCALING_LOGLEVEL", pre=True)
302302
@classmethod
303303
def _valid_log_level(cls, value: str) -> str:
304304
return cls.validate_log_level(value)

services/clusters-keeper/src/simcore_service_clusters_keeper/core/settings.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,9 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
311311
"(default to seconds, or see https://pydantic-docs.helpmanual.io/usage/types/#datetime-types for string formating)",
312312
)
313313

314-
CLUSTERS_KEEPER_MAX_MISSED_HEARTBEATS_BEFORE_CLUSTER_TERMINATION: NonNegativeInt = (
315-
Field(
316-
default=5,
317-
description="Max number of missed heartbeats before a cluster is terminated",
318-
)
314+
CLUSTERS_KEEPER_MAX_MISSED_HEARTBEATS_BEFORE_CLUSTER_TERMINATION: NonNegativeInt = Field(
315+
default=5,
316+
description="Max number of missed heartbeats before a cluster is terminated",
319317
)
320318

321319
CLUSTERS_KEEPER_COMPUTATIONAL_BACKEND_DOCKER_IMAGE_TAG: str = Field(
@@ -352,7 +350,7 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
352350
def LOG_LEVEL(self) -> LogLevel: # noqa: N802
353351
return self.CLUSTERS_KEEPER_LOGLEVEL
354352

355-
@validator("CLUSTERS_KEEPER_LOGLEVEL")
353+
@validator("CLUSTERS_KEEPER_LOGLEVEL", pre=True)
356354
@classmethod
357355
def valid_log_level(cls, value: str) -> str:
358356
return cls.validate_log_level(value)

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
165165
def are_prometheus_metrics_enabled(self) -> bool:
166166
return self.DY_SIDECAR_CALLBACKS_MAPPING.metrics is not None
167167

168-
@validator("LOG_LEVEL")
168+
@validator("LOG_LEVEL", pre=True)
169169
@classmethod
170-
def _check_log_level(cls, value):
170+
def _check_log_level(cls, value: str) -> str:
171171
return cls.validate_log_level(value)
172172

173173

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
9696
def LOG_LEVEL(self) -> LogLevel: # noqa: N802
9797
return self.EFS_GUARDIAN_LOGLEVEL
9898

99-
@validator("EFS_GUARDIAN_LOGLEVEL")
99+
@validator("EFS_GUARDIAN_LOGLEVEL", pre=True)
100100
@classmethod
101101
def valid_log_level(cls, value: str) -> str:
102102
return cls.validate_log_level(value)

services/invitations/src/simcore_service_invitations/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class _BaseApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
5454
def LOG_LEVEL(self):
5555
return self.INVITATIONS_LOGLEVEL
5656

57-
@validator("INVITATIONS_LOGLEVEL")
57+
@validator("INVITATIONS_LOGLEVEL", pre=True)
5858
@classmethod
5959
def valid_log_level(cls, value: str) -> str:
6060
return cls.validate_log_level(value)

services/payments/src/simcore_service_payments/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class _BaseApplicationSettings(BaseApplicationSettings, MixinLoggingSettings):
4848
def LOG_LEVEL(self): # noqa: N802
4949
return self.PAYMENTS_LOGLEVEL
5050

51-
@validator("PAYMENTS_LOGLEVEL")
51+
@validator("PAYMENTS_LOGLEVEL", pre=True)
5252
@classmethod
5353
def valid_log_level(cls, value: str) -> str:
5454
return cls.validate_log_level(value)

services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class _BaseApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
6464
def LOG_LEVEL(self) -> LogLevel: # noqa: N802
6565
return self.RESOURCE_USAGE_TRACKER_LOGLEVEL
6666

67-
@validator("RESOURCE_USAGE_TRACKER_LOGLEVEL")
67+
@validator("RESOURCE_USAGE_TRACKER_LOGLEVEL", pre=True)
6868
@classmethod
6969
def valid_log_level(cls, value: str) -> str:
7070
return cls.validate_log_level(value)

services/web/server/src/simcore_service_webserver/application_settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ def log_level(self) -> int:
287287
level: int = getattr(logging, self.WEBSERVER_LOGLEVEL.upper())
288288
return level
289289

290-
@validator("WEBSERVER_LOGLEVEL")
290+
@validator("WEBSERVER_LOGLEVEL", pre=True)
291291
@classmethod
292-
def valid_log_level(cls, value):
292+
def valid_log_level(cls, value: str) -> str:
293293
return cls.validate_log_level(value)
294294

295295
@validator("SC_HEALTHCHECK_TIMEOUT", pre=True)

0 commit comments

Comments
 (0)