!在调试keystone遇到问题,evenlet线程出错,解决办法参考: http://adam.younglogic.com/2012/12/keystone-and-eclipse-pydev/,主要是在调试keystone-all时增加启动参数,–standard-threads解决,其实里面也有说明,在用pydev调试是需要将monkeypatch_thread设置为False。
!原因:cannot switch to a different thread
keystone-all.py启动keystone服务,所以从keystone-all来入手分析。
首先将keystone源码目录下的模块路径进行设置,将目录配置在系统目录下。
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(__file__),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir,
'keystone',
'__init__.py')):
sys.path.insert(0, possible_topdir)
再引入目录下的其他模块
from paste import deploy
import pbr.version
from keystone.openstack.common import gettextutils
gettextutils.install('keystone', lazy=True)
引入paste.deploy模块,这个模块官方的解释是,Paste Deployment is a system for finding and configuring WSGI applications and servers.意思是这个模块是一个用于发现和配置WSGI应用或者服务的系统。官方网址是:
paste.deploy模块官方网址
WSGI(Web Server Gateway Interface)是一个协议,Python应用程序或框架和Web服务器之间的一种接口,我总结的通俗说法就是将Python应用程序的某些接口转变成Web上的接口可以通过http服务来进行调用。官方网址是:PEP 333,python2.7 wsgi官方网址
pbr模块是用于安装时配置的一个模块,官方解释是:PBR is a library that injects some useful and sensible default behaviors into your setuptools run.意思是PBR是一个库,用于注入一些有用的和敏感的基本配置信息到setuptools.setuptools是一个工具用于下载,编译,安装,升级,卸载python的包文件。
pbr的官方网址是:pbr官方网址
setuptools的官方网址是:setuptools官方网址
gexttextutil是一个运行后加载的模块,用于识别用户的提交的语言,帮助返回错误信息时使用用户语言。
from keystone.comm