@@ -65,25 +65,22 @@ def available() -> None:
65
65
)
66
66
raise typer .Exit (1 ) from exc
67
67
azure_sdk = AzureSdk (context .subscription_name )
68
- blobs = azure_sdk .list_blobs (
69
- container_name = context .storage_container_name ,
70
- prefix = "sre" ,
71
- resource_group_name = context .resource_group_name ,
72
- storage_account_name = context .storage_account_name ,
73
- )
68
+ try :
69
+ blobs = azure_sdk .list_blobs (
70
+ container_name = context .storage_container_name ,
71
+ prefix = "sref" ,
72
+ resource_group_name = context .resource_group_name ,
73
+ storage_account_name = context .storage_account_name ,
74
+ )
75
+ except DataSafeHavenAzureStorageError as exc :
76
+ logger .critical ("Ensure SHM is deployed before attempting to use SRE configs." )
77
+ raise typer .Exit (1 ) from exc
78
+ if not blobs :
79
+ logger .critical (f"No configurations found for context '{ context .name } '." )
80
+ raise typer .Exit (1 )
74
81
console .print (f"Available SRE configurations for context '{ context .name } ':" )
75
82
for blob in blobs :
76
83
console .print (blob )
77
- # try:
78
- # sre_configs = SREConfig.available(context)
79
- # except DataSafeHavenAzureStorageError as exc:
80
- # logger.critical("Ensure SHM is deployed before attempting to use SRE configs.")
81
- # raise typer.Exit(1) from exc
82
- # except DataSafeHavenError as exc:
83
- # logger.critical("No configurations found for the selected context.")
84
- # raise typer.Exit(1) from exc
85
- # for sre_config in sre_configs:
86
- # console.print(sre_config.name)
87
84
88
85
89
86
@config_command_group .command ()
0 commit comments