Open muraiki opened 10 years ago
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)
Update of a apache cinder-api wsgi usable in the kilo release:
import sys
from oslo_log 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(CONF, "cinder")
rpc.init(CONF)
conf = '/etc/cinder/api-paste.ini'
name = "osapi_volume"
application = deploy.loadapp('config:%s' % conf, name=name)
In cinder_modwsgi.py, cinder.flags is used to handle arguments but flags no longer exists; as such, the supplied cinder_modwsgi.py file will not work for Cinder on the Icehouse release.
It seems that flags has been removed in favor of using oslo.config. However, as the transition to using oslo.config is not complete, cinder.common.config is actually a wrapper around oslo.config that tries to emulate gflags. More information can be found in cinder/common/config.py and this commit.
In the meantime I've tried using this as a wsgi script:
However, it results in the following stack trace:
This is probably happening because the defaults from
config.py
are being used. As such, the question is how do we get our settings from/etc/cinder/cinder.conf
into Cinder?I'm not terribly familiar with Cinder and Oslo, nor am I using Chef, but this is one of the few (albeit not currently working) examples of using Cinder with mod_wsgi I could find. Thank you!