alan-turing-institute / data-safe-haven

https://data-safe-haven.readthedocs.io
BSD 3-Clause "New" or "Revised" License
50 stars 14 forks source link

More gracefully handle tearing down non-existent context infrastructure #1917

Open craddm opened 1 month ago

craddm commented 1 month ago

:white_check_mark: Checklist

:strawberry: Suggested change

When using dsh context teardown for a context with no deployed infrastructure, the error message could be cleaner, simply stating that no context infrastructure is currently deployed for the selected context.

(data-safe-haven) deploydsh@5c85686fc4dd:/workspaces/data-safe-haven$ dsh context teardown
2024-05-23 15:26:10 [    INFO] Reading project settings from '/home/deploydsh/.config/data_safe_haven/contexts.yaml'.                                                                context_settings.py:152
2024-05-23 15:26:11 [   ERROR] Failed to destroy context resources.                                                                                                                               cli.py:104
2024-05-23 15:26:11 [   ERROR] Failed to remove resource group shm-chickpea-rg-context.                                                                                                           cli.py:104
2024-05-23 15:26:11 [   ERROR] (ResourceGroupNotFound) Resource group 'shm-chickpea-rg-context' could not be found.                                                                               cli.py:104
2024-05-23 15:26:11 [   ERROR] Code: ResourceGroupNotFound                                                                                                                                        cli.py:104
2024-05-23 15:26:11 [   ERROR] Message: Resource group 'shm-chickpea-rg-context' could not be found.

:steam_locomotive: How could this be done?