Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Fix: Storage table never deleted (#690)
Browse files Browse the repository at this point in the history
* fix bad detection of table existence, delete if exist

* remove unused import

* fix double retry logic
  • Loading branch information
jafreck committed Dec 7, 2018
1 parent a91690b commit 723995c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions aztk/client/cluster/helpers/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,19 @@ def delete_pool_and_job_and_table(core_cluster_operations, pool_id: str, keep_lo

pool_exists = core_cluster_operations.batch_client.pool.exists(pool_id)

table_exists = core_cluster_operations.table_service.exists(pool_id)
table_deleted = core_cluster_operations.delete_task_table(pool_id)

if job_exists:
delete_object(core_cluster_operations.batch_client.job.delete, pool_id)

if pool_exists:
delete_object(core_cluster_operations.batch_client.pool.delete, pool_id)

if table_exists:
delete_object(core_cluster_operations.delete_task_table, pool_id)

if not keep_logs:
cluster_data = core_cluster_operations.get_cluster_data(pool_id)
cluster_data.delete_container(pool_id)

return job_exists or pool_exists or table_exists
return job_exists or pool_exists or table_deleted


@retry(retry_count=4, retry_interval=1, backoff_policy=BackOffPolicy.exponential, exceptions=(ClientRequestError))
Expand Down

0 comments on commit 723995c

Please sign in to comment.