Skip to content

Commit

Permalink
Catch errors when no pulumi config present
Browse files Browse the repository at this point in the history
  • Loading branch information
craddm committed Oct 29, 2024
1 parent 22d7f3b commit db0448a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions data_safe_haven/infrastructure/programs/imperative_shm.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,12 @@ def teardown(self) -> None:
DataSafeHavenAzureError if any resources cannot be destroyed
"""
logger = get_logger()
pulumi_config = DSHPulumiConfig.from_remote(self.context)
deployed = pulumi_config.project_names
try:
pulumi_config = DSHPulumiConfig.from_remote(self.context)
deployed = pulumi_config.project_names
except DataSafeHavenAzureError:
deployed = None
pass
if deployed:
logger.info(f"Found deployed SREs: {deployed}.")
msg = "Deployed SREs must be torn down before the SHM can be torn down."
Expand Down

0 comments on commit db0448a

Please sign in to comment.