gke.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:cloudark 作者: cloud-ark 项目源码 文件源码
def _delete_network(self, project, cluster_name):
        try:
            resp = self.compute_service.networks().delete(
                project=project,
                network=cluster_name
            ).execute()
        except Exception as e:
            fmlogger.error(e)

        network_deleted = False
        count = 0
        while not network_deleted and count < GCLOUD_ACTION_TIMEOUT:
            try:
                network_obj = self.compute_service.networks().get(
                    project=project,
                    network=cluster_name
                ).execute()
            except Exception as e:
                fmlogger.error(e)
                network_deleted = True
            else:
                time.sleep(1)
                count = count + 1

        if count >= GCLOUD_ACTION_TIMEOUT:
            message = ("Failed to delete network {network_name}").format(network_name=cluster_name)
            raise exceptions.EnvironmentDeleteFailure("Failed to delete network ")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号