继续调试nova-api,发现错误:
File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 244, in loadcontext
% (scheme, ', '.join(_loaders.keys())))
LookupError: URI scheme not known: 'call' (from egg, config)
单独拿出来调试,call是什么东西呢?看看配置文件,有点像地址前缀:
[root@xgtest scripts]# grep call /etc/nova/api-paste.ini
use = call:nova.api.auth:pipeline_factory
use = call:nova.api.openstack.urlmap:urlmap_factory
use = call:nova.api.openstack.urlmap:urlmap_factory
use = call:nova.api.auth:pipeline_factory
use = call:nova.api.auth:pipeline_factory
在看看其他前缀呢?
[root@xgtest scripts]# grep egg /etc/nova/api-paste.ini
use = egg:Paste#urlmap
use = egg:Paste#urlmap
这就明白了,直接跟代码里面去:
def _loadconfig(object_type, uri, path, name, relative_to,
global_conf):
301 isabs = os.path.isabs(path)
302 # De-Windowsify the paths:
303 path = path.replace('\\', '/')
304 if not isabs:
305 if not relative_to:
306 raise ValueError(
307 "Cannot resolve relative uri %r; no relative_to keyword "
308 "argument given" % uri)
309 relative_to = relative_to.replace('\\', '/')
310 if relative_to.endswith('/'):
311 path = relative_to + path
312 else:
313 path = relative_to + '/' + path
314 if path.startswith('///'):
315 path = path[2:]
316 path = unquote(path)
317 loader = ConfigLoader(path)
318 if global_conf:
319 loader.update_defaults(global_conf, overwrite=False)
320 return loader.get_context(object_type, name, global_conf)
321
322 _loaders['config'] = _loadconfig
323
324
325 def _loadegg(object_type, uri, spec, name, relative_to,
326 global_conf):
327 loader = EggLoader(spec)
328 return loader.get_context(object_type, name, global_conf
330 _loaders['egg'] = _loadegg
333 def _loadfunc(object_type, uri, spec, name, relative_to,
334 global_conf):
336 loader = FuncLoader(spec)
337 return loader.get_context(object_type, name, global_conf)
这几明白了,查看好的环境,对比下:/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py
发现确实少了代码:
325 def _loadegg(object_type, uri, spec, name, relative_to,
326 global_conf):
327 loader = EggLoader(spec)
328 return loader.get_context(object_type, name, global_conf)
329
330 _loaders['egg'] = _loadegg
331
332
333 def _loadfunc(object_type, uri, spec, name, relative_to,
334 global_conf):
336 loader = FuncLoader(spec)
337 return loader.get_context(object_type, name, global_conf)
339 _loaders['call'] = _loadfunc
拿好的paste.deply覆盖一次,或者直接安装一个正确的paste版本