From 45d2ed685b004a8eec2588528d54c49e637aa374 Mon Sep 17 00:00:00 2001 From: Victor Skvortsov Date: Wed, 11 Dec 2024 16:37:45 +0500 Subject: [PATCH] Fix errors exit codes in dstack apply --- src/dstack/_internal/cli/services/configurators/fleet.py | 1 + src/dstack/_internal/cli/services/configurators/gateway.py | 1 + src/dstack/_internal/cli/services/configurators/volume.py | 1 + 3 files changed, 3 insertions(+) diff --git a/src/dstack/_internal/cli/services/configurators/fleet.py b/src/dstack/_internal/cli/services/configurators/fleet.py index a792c1de7..007150b11 100644 --- a/src/dstack/_internal/cli/services/configurators/fleet.py +++ b/src/dstack/_internal/cli/services/configurators/fleet.py @@ -144,6 +144,7 @@ def apply_configuration( ) if _failed_provisioning(fleet): console.print("\n[error]Some instances failed. Check the table above for errors.[/]") + exit(1) def delete_configuration( self, diff --git a/src/dstack/_internal/cli/services/configurators/gateway.py b/src/dstack/_internal/cli/services/configurators/gateway.py index 8b2ab7824..71fbd4f6b 100644 --- a/src/dstack/_internal/cli/services/configurators/gateway.py +++ b/src/dstack/_internal/cli/services/configurators/gateway.py @@ -130,6 +130,7 @@ def apply_configuration( console.print( f"\n[error]Provisioning failed. Error: {gateway.status_message or 'unknown'}[/]" ) + exit(1) def delete_configuration( self, diff --git a/src/dstack/_internal/cli/services/configurators/volume.py b/src/dstack/_internal/cli/services/configurators/volume.py index 41d961519..ab53d2d59 100644 --- a/src/dstack/_internal/cli/services/configurators/volume.py +++ b/src/dstack/_internal/cli/services/configurators/volume.py @@ -126,6 +126,7 @@ def apply_configuration( console.print( f"\n[error]Provisioning failed. Error: {volume.status_message or 'unknown'}[/]" ) + exit(1) def delete_configuration( self,