__init__.py 文件源码

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

项目:clouds-aws 作者: elias5000 项目源码 文件源码
def wait(stack, show_events=False, last_event=None):
    """wait for stack action to complete"""
    global REGION

    stack_obj = boto3.resource('cloudformation', region_name=REGION).Stack(stack)
    while True:
        try:
            stack_obj.reload()

            # display new events
            if show_events:
                last_event = stack_events(stack, last_event=last_event)

            # exit condition
            if stack_obj.stack_status[-8:] == 'COMPLETE':
                break
            if stack_obj.stack_status == 'DELETE_FAILED':
                break

        except botocore.exceptions.ClientError:
            break

        # limit requests to API
        sleep(5)


# command functions
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号