From 3495a7214c39f948bcef1b9577fbfb03a15ae887 Mon Sep 17 00:00:00 2001 From: William Chu Date: Tue, 10 Sep 2024 12:26:41 +0800 Subject: [PATCH] fix: async run should not default to exit code of 1 --- docker-compose.yml | 1 - gitops_server/utils/__init__.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index cc3c652..4d3f887 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: "3.8" services: web: build: . diff --git a/gitops_server/utils/__init__.py b/gitops_server/utils/__init__.py index 7e3fcc9..74f019f 100644 --- a/gitops_server/utils/__init__.py +++ b/gitops_server/utils/__init__.py @@ -19,7 +19,7 @@ async def run(command, suppress_errors=False) -> RunOutput: ) stdout, stderr = await proc.communicate() - exit_code = proc.returncode or 1 + exit_code = proc.returncode if proc.returncode not in (None, 128) else 1 # type: ignore if exit_code == 0: return RunOutput(exit_code=exit_code, output=stdout.decode()) else: