driver.py 文件源码

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

项目:kuryr-libnetwork 作者: openstack 项目源码 文件源码
def get_driver_instance():
    """Instantiate a driver instance accordingly to the file configuration.

    :returns: a Driver instance
    :raises: exceptions.KuryrException
    """
    module, name, classname = _parse_port_driver_config()

    # TODO(apuimedo): switch to the openstack/stevedore plugin system
    try:
        driver = importutils.import_object("{0}.{1}".format(module, classname))
    except ImportError as ie:
        raise exceptions.KuryrException(
            "Cannot load port driver '{0}': {1}".format(module, ie))

    _verify_port_driver_compliancy(driver, name)
    _verify_binding_driver_compatibility(driver, name)

    return driver
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号