stevedore

#Sora#openstack基础库stevedore试用总结

随声附和 提交于 2020-04-21 08:30:35
什么是stevedore? stevedore是建立在setuptools的entry point的功能上的,用于python程序动态加载代码,在openstack中被多个组件使用:比如ceilometer,neutron的plugin。当然,你可以直接使用 python的某些黑魔法实现插件的加载,但太原始了。stevedore基于entry point提供了更高层次的封装。 stevedore的官方文档在此: http://docs.openstack.org/developer/stevedore/ 学习和入门setuptools: http://www.360doc.com/content/14/0306/11/13084517_358166737.shtml 官方文档的部分翻译: http://www.360doc.com/content/14/0429/19/9482_373285413.shtml 来自华为孔令贤(源地址非该人博客)的setup.py详解: http://blog.sina.com.cn/s/blog_4951301d0101etvj.html 偶计划在sora项目中引入stevedore与oslo.config简化某些开发的组件,先是测试了stevedore,写了个简单的scheduler插件 环境准备: 安装stevedore库,及组织相关目录