You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by lf...@apache.org on 2022/09/08 08:41:12 UTC

[incubator-datalab] 01/03: [DATALAB-1408]: cluster storage account is now deleted if cluster is not found

This is an automated email from the ASF dual-hosted git repository.

lfrolov pushed a commit to branch DATALAB-1408
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit 92f98b56fc181a6f4ca031ffa6aae295fc0f8d54
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Thu Sep 8 11:04:18 2022 +0300

    [DATALAB-1408]: cluster storage account is now deleted if cluster is not found
---
 .../src/general/scripts/azure/dataengine-service_terminate.py    | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/infrastructure-provisioning/src/general/scripts/azure/dataengine-service_terminate.py b/infrastructure-provisioning/src/general/scripts/azure/dataengine-service_terminate.py
index 1c7701644..cf0fc316c 100644
--- a/infrastructure-provisioning/src/general/scripts/azure/dataengine-service_terminate.py
+++ b/infrastructure-provisioning/src/general/scripts/azure/dataengine-service_terminate.py
@@ -66,13 +66,14 @@ if __name__ == "__main__":
     try:
         logging.info('[TERMINATE HDINSIGHT CLUSTER AND ASSOCIATED RESOURCES]')
         try:
-            cluster = AzureMeta.get_hdinsight_cluster(hdinsight_conf['resource_group_name'], hdinsight_conf['cluster_name'])
+            cluster = AzureMeta.get_hdinsight_cluster(hdinsight_conf['resource_group_name'],
+                                                      hdinsight_conf['cluster_name'])
             if cluster and cluster.properties.cluster_state == 'Running':
                 AzureActions.terminate_hdinsight_cluster(hdinsight_conf['resource_group_name'],
                                                          hdinsight_conf['cluster_name'])
-                for storage_account in AzureMeta.list_storage_accounts(hdinsight_conf['resource_group_name']):
-                    if hdinsight_conf['storage_account_name_tag'] == storage_account.tags["Name"]:
-                        AzureActions.remove_storage_account(hdinsight_conf['resource_group_name'], storage_account.name)
+            for storage_account in AzureMeta.list_storage_accounts(hdinsight_conf['resource_group_name']):
+                if hdinsight_conf['storage_account_name_tag'] == storage_account.tags["Name"]:
+                    AzureActions.remove_storage_account(hdinsight_conf['resource_group_name'], storage_account.name)
         except Exception as err:
             traceback.print_exc()
             datalab.fab.append_result("Failed to terminate hdinsight cluster.", str(err))


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org