gdistcc.py 文件源码

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

项目:gdistcc 作者: apeabody 项目源码 文件源码
def wait_operation(operation):

    # NOT thread safe
    credentials = GoogleCredentials.get_application_default()
    compute = discovery.build('compute', 'v1', credentials=credentials)

    # Wait for confirmation that the instance is created
    while True:
        result = compute.zoneOperations().get(
            project=project,
            zone=zone,
            operation=operation['name']).execute()

        if result['status'] == 'DONE':
            return False if ('error' in result) else True

        sys.stdout.write(".")
        sys.stdout.flush()

        time.sleep(2)
# [END wait_operation]


# [START list_instances]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号