Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit fa28f11
Author: Stamatis Katsaounis <stamatis.katsaounis@canonical.com>
Date:   Tue Aug 27 12:34:30 2024 +0300

    fix: do not ask question on skipped steps (canonical#53)

commit 9f85390
Author: Stamatis Katsaounis <stamatis.katsaounis@canonical.com>
Date:   Tue Aug 27 06:29:28 2024 +0300

    fix: set bootstrapped flag (canonical#52)
  • Loading branch information
SK1Y101 committed Aug 27, 2024
1 parent 6863c11 commit c341460
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
8 changes: 6 additions & 2 deletions anvil-python/anvil/commands/haproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 5 additions & 1 deletion anvil-python/anvil/commands/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 3 additions & 0 deletions anvil-python/anvil/provider/local/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from rich.table import Table
from snaphelpers import Snap
from sunbeam import utils
from sunbeam.commands.bootstrap_state import SetBootstrapped
from sunbeam.commands.clusterd import (
ClusterAddJujuUserStep,
ClusterAddNodeStep,
Expand Down Expand Up @@ -306,6 +307,8 @@ def bootstrap(
fqdn,
)
)

plan4.append(SetBootstrapped(client))
run_plan(plan4, console)

click.echo(f"Node has been bootstrapped with roles: {pretty_roles}")
Expand Down

0 comments on commit c341460

Please sign in to comment.