Skip to content

Commit 100fbb7

Browse files
author
Andrei Neagu
committed
refactored messages
1 parent 30e5521 commit 100fbb7

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/services/containers.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ async def get_containers_name(app: FastAPI, *, filters: str) -> str | dict[str,
194194

195195
class ContainerIsMissingError(OsparcErrorMixin, RuntimeError):
196196
msg_template: str = (
197-
"No container '{container_id}' was started. Started containers '{container_names}'"
197+
"No container='{container_id}' was found in started_containers='{container_names}'"
198198
)
199199

200200

@@ -208,8 +208,11 @@ async def inspect_container(
208208

209209
container_names = shared_store.container_names
210210
if container_id not in container_names:
211-
message = f"No container '{container_id}' was started. Started containers '{container_names}'"
212-
_logger.warning(message)
211+
_logger.warning(
212+
"No container='%s' was found in started_containers='%s'",
213+
container_id,
214+
container_names,
215+
)
213216
raise ContainerIsMissingError(
214217
container_id=container_id, container_names=container_names
215218
)

services/dynamic-sidecar/tests/unit/test_api_rest_containers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ async def test_container_missing_container(
444444
):
445445
def _expected_error_string(container: str) -> dict[str, str]:
446446
return {
447-
"detail": f"No container '{container}' was started. Started containers '[]'"
447+
"detail": f"No container='{container}' was found in started_containers='[]'"
448448
}
449449

450450
for container in not_started_containers:

0 commit comments

Comments
 (0)