From fa28f11e53d4a4d016b89dc779b899d58e1bf73f Mon Sep 17 00:00:00 2001 From: Stamatis Katsaounis Date: Tue, 27 Aug 2024 12:34:30 +0300 Subject: [PATCH] fix: do not ask question on skipped steps (#53) --- anvil-python/anvil/commands/haproxy.py | 8 ++++++-- anvil-python/anvil/commands/postgresql.py | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/anvil-python/anvil/commands/haproxy.py b/anvil-python/anvil/commands/haproxy.py index 2617ffe..e35d29d 100644 --- a/anvil-python/anvil/commands/haproxy.py +++ b/anvil-python/anvil/commands/haproxy.py @@ -21,7 +21,7 @@ from sunbeam.clusterd.client import Client from sunbeam.commands.terraform import TerraformInitStep from sunbeam.jobs import questions -from sunbeam.jobs.common import BaseStep +from sunbeam.jobs.common import BaseStep, ResultType from sunbeam.jobs.juju import JujuHelper from sunbeam.jobs.steps import ( AddMachineUnitsStep, @@ -106,7 +106,11 @@ def has_prompts(self) -> bool: if self.refresh: return False - return True + skip_result = self.is_skip() + if skip_result.result_type == ResultType.SKIPPED: + return False + else: + return True def prompt(self, console: Console | None = None) -> None: variables = questions.load_answers( diff --git a/anvil-python/anvil/commands/postgresql.py b/anvil-python/anvil/commands/postgresql.py index 89eb1b4..219edbc 100644 --- a/anvil-python/anvil/commands/postgresql.py +++ b/anvil-python/anvil/commands/postgresql.py @@ -182,7 +182,11 @@ def has_prompts(self) -> bool: if self.refresh: return False - return True + skip_result = self.is_skip() + if skip_result.result_type == ResultType.SKIPPED: + return False + else: + return True class ReapplyPostgreSQLTerraformPlanStep(DeployMachineApplicationStep):