This is an automated email from the ASF dual-hosted git repository. lfrolov pushed a commit to branch DLAB-1665 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 3cd0badd59ce0f4032ec4b0be9e8da9512584b84 Author: leonidfrolov <[email protected]> AuthorDate: Fri Mar 27 16:22:55 2020 +0200 [DLAB-1665]: added removal of project specific images during project termination on azure --- .../src/general/scripts/azure/project_terminate.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/infrastructure-provisioning/src/general/scripts/azure/project_terminate.py b/infrastructure-provisioning/src/general/scripts/azure/project_terminate.py index 7354c3d..68fd89c 100644 --- a/infrastructure-provisioning/src/general/scripts/azure/project_terminate.py +++ b/infrastructure-provisioning/src/general/scripts/azure/project_terminate.py @@ -112,6 +112,16 @@ def terminate_edge_node(resource_group_name, service_base_name, project_tag, sub dlab.fab.append_result("Failed to remove Data Lake.", str(err)) sys.exit(1) + print("Removing project specific images") + try: + for image in AzureMeta.list_images(): + if service_base_name == image.tags["SBN"] and project_tag == image.tags["project_tag"]: + AzureActions.remove_image(resource_group_name, image.name) + print("Image {} has been removed".format(image.name)) + except Exception as err: + dlab.fab.append_result("Failed to remove images", str(err)) + sys.exit(1) + print("Removing security groups") try: for sg in AzureMeta.network_client.network_security_groups.list(resource_group_name): --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
