Skip to content

Commit 421936c

Browse files
author
Andrei Neagu
committed
refactor
1 parent fc791b9 commit 421936c

File tree

2 files changed

+16
-4
lines changed
  • services/dynamic-scheduler

2 files changed

+16
-4
lines changed

services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/cli.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33

44
import typer
5+
from settings_library.postgres import PostgresSettings
56
from settings_library.rabbit import RabbitSettings
67
from settings_library.utils_cli import (
78
create_settings_command,
@@ -56,6 +57,21 @@ def echo_dotenv(ctx: typer.Context, *, minimal: bool = True):
5657
"DYNAMIC_SCHEDULER_UI_STORAGE_SECRET",
5758
"replace-with-ui-storage-secret",
5859
),
60+
DYNAMIC_SCHEDULER_POSTGRES=os.environ.get(
61+
"DYNAMIC_SCHEDULER_POSTGRES",
62+
PostgresSettings.create_from_envs(
63+
POSTGRES_HOST=os.environ.get(
64+
"POSTGRES_HOST", "replace-with-postgres-host"
65+
),
66+
POSTGRES_USER=os.environ.get(
67+
"POSTGRES_USER", "replace-with-postgres-user"
68+
),
69+
POSTGRES_PASSWORD=os.environ.get(
70+
"POSTGRES_PASSWORD", "replace-with-postgres-password"
71+
),
72+
POSTGRES_DB=os.environ.get("POSTGRES_DB", "replace-with-postgres-db"),
73+
),
74+
),
5975
)
6076

6177
print_as_envfile(

services/dynamic-scheduler/tests/unit/test_cli.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ def app_environment(
4141
"DYNAMIC_SCHEDULER_TRACING": "{}",
4242
"TRACING_OPENTELEMETRY_COLLECTOR_ENDPOINT": "http://replace-with-opentelemetry-collector",
4343
"TRACING_OPENTELEMETRY_COLLECTOR_PORT": "4318",
44-
"RABBIT_HOST": "test",
45-
"RABBIT_SECURE": "0",
46-
"RABBIT_USER": "test",
47-
"RABBIT_PASSWORD": "test",
4844
},
4945
)
5046

0 commit comments

Comments
 (0)