Unable to load module from api-paste.ini [closed]

asked 2015-03-22 04:28:26 -0600

Pradip gravatar image

Hello,

Here is the api-paste.ini snippet:

[app:apiv1]
#paste.app_factory = sdsc.api.router:APIRouter.factory
paste.app_factory = sdsc.api.v1.router:APIRouter.factory

I am seeing an error herein:

2015-03-22 14:53:48.928 TRACE sdsc     section)
2015-03-22 14:53:48.928 TRACE sdsc   File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 517, in _context_from_explicit
2015-03-22 14:53:48.928 TRACE sdsc     value = import_string(found_expr)
2015-03-22 14:53:48.928 TRACE sdsc   File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 22, in import_string
2015-03-22 14:53:48.928 TRACE sdsc     return pkg_resources.EntryPoint.parse("x=" + s).load(False)
2015-03-22 14:53:48.928 TRACE sdsc   File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2320, in load
2015-03-22 14:53:48.928 TRACE sdsc     return self.resolve()
2015-03-22 14:53:48.928 TRACE sdsc   File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2326, in resolve
2015-03-22 14:53:48.928 TRACE sdsc     module = __import__(self.module_name, fromlist=['__name__'], level=0)
2015-03-22 14:53:48.928 TRACE sdsc ImportError: No module named v1.router
2015-03-22 14:53:48.928 TRACE sdsc

However when I am moving moving the content of "v1" to the "api" directory, all can be loaded successfully. So apparently looks like somewhere I need to mention "v1" such that it can be loaded by Paste.

Not able to figure out ...

Thanks in advance, Pradip

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Pradip
close date 2015-03-24 08:18:45.007420

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-03-24 08:18:02 -0600

Pradip gravatar image

Missed the __init__.py in the "sdsc.api.v1.router" directory where it was failing.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2015-03-22 04:28:26 -0600

Seen: 197 times

Last updated: Mar 24 '15