Make it possible to use uwsgi easily
This patch adds a standard /usr/bin/magnum-api-uwsgi script, which we can use from uwsgi. Without this patch, there's no way to load the application correctly, with parameters on the command line. Change-Id: Icdcd1255e7e08d68a5d31672b21127f781d6ac68
This commit is contained in:
parent
a673cd57aa
commit
0d39f3535d
|
@ -10,6 +10,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
@ -19,6 +20,7 @@ import pecan
|
||||||
from magnum.api import config as api_config
|
from magnum.api import config as api_config
|
||||||
from magnum.api import middleware
|
from magnum.api import middleware
|
||||||
from magnum.common import config as common_config
|
from magnum.common import config as common_config
|
||||||
|
from magnum.common import service
|
||||||
import magnum.conf
|
import magnum.conf
|
||||||
|
|
||||||
CONF = magnum.conf.CONF
|
CONF = magnum.conf.CONF
|
||||||
|
@ -65,3 +67,8 @@ def load_app():
|
||||||
|
|
||||||
def app_factory(global_config, **local_conf):
|
def app_factory(global_config, **local_conf):
|
||||||
return setup_app()
|
return setup_app()
|
||||||
|
|
||||||
|
|
||||||
|
def build_wsgi_app(argv=None):
|
||||||
|
service.prepare_service(sys.argv)
|
||||||
|
return load_app()
|
||||||
|
|
|
@ -47,6 +47,9 @@ console_scripts =
|
||||||
magnum-driver-manage = magnum.cmd.driver_manage:main
|
magnum-driver-manage = magnum.cmd.driver_manage:main
|
||||||
magnum-status = magnum.cmd.status:main
|
magnum-status = magnum.cmd.status:main
|
||||||
|
|
||||||
|
wsgi_scripts =
|
||||||
|
magnum-api-wsgi = magnum.api.app:build_wsgi_app
|
||||||
|
|
||||||
oslo.config.opts =
|
oslo.config.opts =
|
||||||
magnum = magnum.opts:list_opts
|
magnum = magnum.opts:list_opts
|
||||||
magnum.conf = magnum.conf.opts:list_opts
|
magnum.conf = magnum.conf.opts:list_opts
|
||||||
|
|
Loading…
Reference in New Issue