From 901ae41dffbb8395a8a177d5ab3089c3459e79ad Mon Sep 17 00:00:00 2001 From: Maged Motawea Date: Thu, 1 Oct 2020 16:16:19 +0200 Subject: [PATCH] Development clean minio workloads (#1345) * clean workloads if volumes fail to deploy * clean workloads if volumes fail to deploy --- jumpscale/sals/reservation_chatflow/deployer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jumpscale/sals/reservation_chatflow/deployer.py b/jumpscale/sals/reservation_chatflow/deployer.py index 62f3a2e2c2..5074c152ea 100644 --- a/jumpscale/sals/reservation_chatflow/deployer.py +++ b/jumpscale/sals/reservation_chatflow/deployer.py @@ -1455,6 +1455,8 @@ def deploy_minio_containers( master_volume_id = self.deploy_volume(pool_id, minio_nodes[0], disk_size, disk_type, **metadata) success = self.wait_workload(master_volume_id, bot) if not success: + j.sals.reservation_chatflow.solutions.cancel_solution([master_volume_id]) + j.sals.reservation_chatflow.solutions.block_node(minio_nodes[0]) raise StopChatFlow( f"Failed to create volume {master_volume_id} for minio container on" f" node {minio_nodes[0]}" ) @@ -1479,6 +1481,8 @@ def deploy_minio_containers( slave_volume_id = self.deploy_volume(pool_id, minio_nodes[1], disk_size, disk_type, **metadata) success = self.wait_workload(slave_volume_id, bot) if not success: + j.sals.reservation_chatflow.solutions.cancel_solution([slave_volume_id]) + j.sals.reservation_chatflow.solutions.block_node(minio_nodes[1]) raise StopChatFlow( f"Failed to create volume {slave_volume_id} for minio container on" f" node {minio_nodes[1]}" )