rds.py 文件源码

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

项目:ansible_mysql_rds_playbook 作者: codingenesis 项目源码 文件源码
def await_resource(conn, resource, status, module):
    wait_timeout = module.params.get('wait_timeout') + time.time()
    while wait_timeout > time.time() and resource.status != status:
        time.sleep(5)
        if wait_timeout <= time.time():
            module.fail_json(msg="Timeout waiting for RDS resource %s" % resource.name)
        if module.params.get('command') == 'snapshot':
            # Temporary until all the rds2 commands have their responses parsed
            if resource.name is None:
                module.fail_json(msg="There was a problem waiting for RDS snapshot %s" % resource.snapshot)
            resource = conn.get_db_snapshot(resource.name)
        else:
            # Temporary until all the rds2 commands have their responses parsed
            if resource.name is None:
                module.fail_json(msg="There was a problem waiting for RDS instance %s" % resource.instance)
            resource = conn.get_db_instance(resource.name)
            if resource is None:
                break
    return resource
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号