From 85875e802a9580125b75169cf1052ada60ed905a Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:18:50 +0100 Subject: [PATCH] revert --- .../modules/dynamic_sidecar/docker_api/_core.py | 2 +- .../modules/dynamic_sidecar/errors.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_api/_core.py b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_api/_core.py index 7772d0d67be..1e05524b48d 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_api/_core.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_api/_core.py @@ -487,7 +487,7 @@ async def update_scheduler_data_label(scheduler_data: SchedulerData) -> None: }, ) except GenericDockerError as e: - if e.error_context()["original_exception"].status == status.HTTP_404_NOT_FOUND: + if e.original_exception.status == status.HTTP_404_NOT_FOUND: log.info( "Skipped labels update for service '%s' which could not be found.", scheduler_data.service_name, diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/errors.py b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/errors.py index 0ebc222e914..f8b4d01e40c 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/errors.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/errors.py @@ -1,3 +1,7 @@ +from typing import Any + +from aiodocker import DockerError + from ...core.errors import DirectorError @@ -6,6 +10,10 @@ class DynamicSidecarError(DirectorError): class GenericDockerError(DynamicSidecarError): + def __init__(self, original_exception: DockerError, **ctx: Any) -> None: + super().__init__(original_exception=original_exception, **ctx) + self.original_exception = original_exception + msg_template: str = "Unexpected error using docker: {msg}"