hookenv.py 文件源码

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

项目:charm-plumgrid-gateway 作者: openstack 项目源码 文件源码
def relation_id(relation_name=None, service_or_unit=None):
    """The relation ID for the current or a specified relation"""
    if not relation_name and not service_or_unit:
        return os.environ.get('JUJU_RELATION_ID', None)
    elif relation_name and service_or_unit:
        service_name = service_or_unit.split('/')[0]
        for relid in relation_ids(relation_name):
            remote_service = remote_service_name(relid)
            if remote_service == service_name:
                return relid
    else:
        raise ValueError('Must specify neither or both of relation_name and service_or_unit')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号