pre_supervisor_checks.py 文件源码

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

项目:edx-configuration 作者: kola-er 项目源码 文件源码
def edp_for_instance(instance_id):
    ec2 = boto.connect_ec2()
    reservations = ec2.get_all_instances(instance_ids=[instance_id])
    for reservation in reservations:
        for instance in reservation.instances:
            if instance.id == instance_id:
                try:
                    environment = instance.tags['environment']
                    deployment = instance.tags['deployment']
                    play = instance.tags['play']
                except KeyError as ke:
                    msg = "{} tag not found on this instance({})".format(ke.message, instance_id)
                    raise Exception(msg)
                return (environment, deployment, play)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号