From 4719c5e14c01ae919363a6b14cef36afb368f320 Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Sun, 5 May 2024 10:31:19 +1000 Subject: [PATCH] [Resolves #1464] Display launch order Akin to `sceptre delete`, display the order of operations that would occur when issuing `sceptre launch`. --- sceptre/cli/launch.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sceptre/cli/launch.py b/sceptre/cli/launch.py index 637fe5f56..896b696a6 100644 --- a/sceptre/cli/launch.py +++ b/sceptre/cli/launch.py @@ -92,12 +92,27 @@ def print_operations(self, prune: bool): dependencies = "" for stack in deploy_plan: - if stack.ignore or stack.obsolete: - dependencies += "{}{} **skipped{}\n".format(Fore.LIGHTWHITE_EX, stack.name, Style.RESET_ALL) + if stack.ignore or (stack.obsolete and not prune): + dependencies += "{}Skip:\t{}{}\n".format( + Fore.LIGHTWHITE_EX, + stack.name, + Style.RESET_ALL, + ) + elif stack.obsolete and prune: + dependencies += "{}Delete:\t{}{}\n".format( + Fore.RED, + stack.name, + Style.RESET_ALL, + ) else: - dependencies += "{}{}{}\n".format(Fore.YELLOW, stack.name, Style.RESET_ALL) + dependencies += "{}Deploy:\t{}{}\n".format( + Fore.YELLOW, + stack.name, + Style.RESET_ALL, + ) - print(f"The following stacks, in the following order, will be deployed:\n{dependencies}") + print(f"The following operations will occur, in the following order:") + print(dependencies) def launch(self, prune: bool) -> int: deploy_plan = self._create_deploy_plan()