Skip to content

Commit

Permalink
Initialise workdir in StackManager contructor
Browse files Browse the repository at this point in the history
  • Loading branch information
JimMadge committed Sep 25, 2023
1 parent 64a55d8 commit 549a3fe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions data_safe_haven/infrastructure/stack_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def __init__(
self.work_dir = config.work_directory / "pulumi" / self.program.short_name
self.work_dir.mkdir(parents=True, exist_ok=True)
self.login() # Log in to the Pulumi backend
self.initialise_workdir()
self.install_plugins()

@property
def local_stack_path(self) -> pathlib.Path:
Expand Down Expand Up @@ -137,8 +139,6 @@ def copy_secret(self, name: str, other_stack: "StackManager") -> None:
def deploy(self, *, force: bool = False) -> None:
"""Deploy the infrastructure with Pulumi."""
try:
self.initialise_workdir()
self.install_plugins()
self.apply_config_options()
if force:
self.cancel()
Expand Down Expand Up @@ -357,8 +357,6 @@ def set_config(self, name: str, value: str, *, secret: bool) -> None:
def teardown(self) -> None:
"""Teardown the infrastructure deployed with Pulumi."""
try:
self.initialise_workdir()
self.install_plugins()
self.refresh()
self.destroy()
self.remove_workdir()
Expand Down

0 comments on commit 549a3fe

Please sign in to comment.