Ask Your Question
0

cinder mod_wsgi config

asked 2014-07-22 15:22:43 -0500

muraiki gravatar image

Hi all, I'm trying to set up Cinder with mod_wsgi. The stack is the Icehouse version. As a basis for the wsgi script I'm using https://github.com/rcbops-cookbooks/cinder/blob/master/files/default/cinder_modwsgi.py (this). However, using this yields the following error:

ImportError: cannot import name flags

I tried to use Oslo using similar patterns that I've seen in wsgi scripts for other services as follows:

from cinder.common import config

That gives me the following error:

2014-07-22 20:14:33.978 29996 CRITICAL cinder [-] AssertionError
2014-07-22 20:14:33.978 29996 TRACE cinder Traceback (most recent call last):
2014-07-22 20:14:33.978 29996 TRACE cinder   File "cinder-muraiki.wsgi", line 14, in <module>
2014-07-22 20:14:33.978 29996 TRACE cinder     application = deploy.loadapp('config:%s' % conf, name=name)
2014-07-22 20:14:33.978 29996 TRACE cinder   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", l
ine 247, in loadapp
2014-07-22 20:14:33.978 29996 TRACE cinder     return loadobj(APP, uri, name=name, **kw)
2014-07-22 20:14:33.978 29996 TRACE cinder   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", l
ine 272, in loadobj
2014-07-22 20:14:33.978 29996 TRACE cinder     return context.create()
2014-07-22 20:14:33.978 29996 TRACE cinder   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", l
ine 710, in create
2014-07-22 20:14:33.978 29996 TRACE cinder     return self.object_type.invoke(self)
2014-07-22 20:14:33.978 29996 TRACE cinder   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", l
ine 144, in invoke
2014-07-22 20:14:33.978 29996 TRACE cinder     **context.local_conf)
2014-07-22 20:14:33.978 29996 TRACE cinder   File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line 
55, in fix_call
2014-07-22 20:14:33.978 29996 TRACE cinder     val = callable(*args, **kw)
2014-07-22 20:14:33.978 29996 TRACE cinder   File "/opt/stack/cinder/cinder/api/__init__.py", line 30, in root_a
pp_factory
2014-07-22 20:14:33.978 29996 TRACE cinder     return paste.urlmap.urlmap_factory(loader, global_conf, **local_c
onf)
2014-07-22 20:14:33.978 29996 TRACE cinder   File "/usr/lib/python2.7/dist-packages/paste/urlmap.py", line 28, i
n urlmap_factory
2014-07-22 20:14:33.978 29996 TRACE cinder     app = loader.get_app(app_name, global_conf=global_conf)
2014-07-22 20:14:33.978 29996 TRACE cinder   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", l
ine 350, in get_app
2014-07-22 20:14:33.978 29996 TRACE cinder     name=name, global_conf=global_conf).create()
2014-07-22 20:14:33.978 29996 TRACE cinder   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", l
ine 710, in create
2014-07-22 20:14:33.978 29996 TRACE cinder     return self.object_type.invoke(self)
2014-07-22 20:14:33.978 29996 TRACE cinder   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", l
ine 144, in invoke
2014-07-22 20:14:33.978 29996 TRACE cinder     **context.local_conf)
2014-07-22 20:14:33.978 29996 TRACE cinder   File "/usr/lib/python2 ...
(more)
edit retag flag offensive close merge delete

Comments

Here's the commit that indicates that cinder.flags has been removed: https://review.openstack.org/#/c/33030/

muraiki gravatar imagemuraiki ( 2014-07-23 10:39:23 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-07-23 13:08:51 -0500

muraiki gravatar image

updated 2014-07-23 13:17:35 -0500

DuncanT- from #openstack-cinder wrote up this wsgi script, which seems to work ok:

import sys
from cinder.openstack.common import log as logging
from paste import deploy
from cinder.common import config
from oslo.config import cfg
from cinder.openstack.common import gettextutils
from cinder import version
from cinder import rpc

gettextutils.install('cinder')

CONF=cfg.CONF
CONF("", project='cinder', version=version.version_string())
logging.setup("cinder")

rpc.init(CONF)

conf = '/etc/cinder/api-paste.ini'
name = "osapi_volume"

application = deploy.loadapp('config:%s' % conf, name=name)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-07-22 15:21:21 -0500

Seen: 218 times

Last updated: Jul 23 '14